1.样式的引入.html 799 B

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Document</title>
  7. <!-- 外部样式表 -->
  8. <link rel="stylesheet" href="./index.css" />
  9. <style>
  10. /* 内部样式表 */
  11. div {
  12. width: 200px;
  13. height: 200px;
  14. background: #00f;
  15. }
  16. </style>
  17. <!--
  18. link 链接外部表
  19. rel 关系
  20. stylesheet 样式表
  21. href 路径
  22. -->
  23. </head>
  24. <body>
  25. <!-- 行内样式/内联样式 -->
  26. <!-- <div style="width: 200px;height: 200px;background-color: red;"></div> -->
  27. <div></div>
  28. <!--
  29. 同标签 下面的样式会覆盖上面的样式
  30. 行内 > 内部 > 外部
  31. -->
  32. </body>
  33. </html>