3.引入css.html 760 B

12345678910111213141516171819202122232425262728293031
  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. <!-- 外部样式表 -->
  9. <!--
  10. link 导入外部文件
  11. rel 关系
  12. stylesheet 样式表
  13. href 路径
  14. -->
  15. <link rel="stylesheet" href="./index.css">
  16. <style>
  17. /* 内部样式表 */
  18. div {
  19. width: 200px;
  20. height: 200px;
  21. background: #00f;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <!-- 行内 > 内部 > 外部 -->
  27. <!-- 行内样式/内联样式 -->
  28. <div></div>
  29. <!-- <div style="width: 200px;height: 200px;background-color: red;"></div> -->
  30. </body>
  31. </html>