1.引入样式.html 764 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 用于引入外部文件
  9. rel 关系
  10. stylesheet 样式表
  11. href
  12. -->
  13. <!-- 3.外部样式表 -->
  14. <link rel="stylesheet" href="./1.css">
  15. <!-- 2.内部样式表 -->
  16. <style>
  17. div {
  18. width: 200px;
  19. height: 200px;
  20. background: #00f;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <!--
  26. 优先级:
  27. 行内 > 内部 > 外部
  28. -->
  29. <!-- 1.行内样式/内联样式 -->
  30. <!-- <div style="width: 200px;height: 200px;background: #f00;"></div> -->
  31. <div></div>
  32. </body>
  33. </html>