【问题标题】:body{background-color: red;} is not working in external cssbody{background-color: red;} 在外部 CSS 中不起作用
【发布时间】:2022-10-06 22:30:13
【问题描述】:

\"这是我的外部 css 文件名样式.css\"

body{
  background-color: red;
}

h3{
  color: #66BFBF;
}

hr{
  border-style: none;
  border-top-style: dotted;
  border-color: grey; 
  border-width: 3px;  
  width: 5%;
}

\“这是我的名为 index.html 的 html 文件。其中 style.css 正确链接,因为 hr 选择器工作,但不是其他人。\”

<!DOCTYPE html>
<html>
  <head>
    <meta charset=\"UTF-8\">
    <title>Chandan\'s personal site</title>
    <link rel = \"stylesheet\" href =\"CSS\\style.css\">
  </head>
  <body>
    <h1>This is me!<h1>
    <hr>
    <h3>Books & Learning</h3>
  </body>
</html>     
  • 查看检查员的网络面板。你看到任何错误吗? CSS\\style.css 对我来说似乎不正确。我认为应该是CSS/style.css。试试看...

标签: css


【解决方案1】:

当我删除线路时它起作用了 - <lang 'en'>

【讨论】:

    猜你喜欢
    • 2013-06-21
    • 1970-01-01
    • 2011-11-15
    • 2014-06-27
    • 1970-01-01
    • 2016-05-23
    • 1970-01-01
    相关资源
    最近更新 更多