1.样式引入.html 924 B

123456789101112131415161718192021222324252627282930313233343536
  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. <!-- 样式标签:style -->
  8. <!-- 外部样式表 -->
  9. <link rel="stylesheet" href="./1.css">
  10. <!-- 内部样式表 -->
  11. <style>
  12. div {
  13. width: 200px;
  14. height: 200px;
  15. background: #00f;
  16. }
  17. </style>
  18. <!--
  19. link 引入外部表
  20. rek 关系
  21. stylesheet 样式表
  22. href 地址
  23. -->
  24. </head>
  25. <body>
  26. <!-- 行内样式/内联样式 -->
  27. <div></div>
  28. <p>1111</p>
  29. <!-- 相同标签 后面样式会覆盖前面样式 -->
  30. <!--
  31. 样式表优先级
  32. 行内样式 > 内部 = 外部 (谁在后面相同标签优先级大)
  33. -->
  34. <!-- <div style="width: 300px;height: 300px;background: red;"></div> -->
  35. </body>
  36. </html>