【问题标题】:css file is not linked to the rest of the website's pagescss 文件没有链接到网站的其余页面
【发布时间】:2023-01-24 03:38:44
【问题描述】:

我在 VS 代码中为 CSS 添加了一个新文件,并编写了所有样式代码,并在网站的每个页面中编写了链接元素,但 CSS 样式并未应用于该网站

我试图为所有页面应用一种样式,我希望它能正常工作


body {
    background-color:#b3e6ee
}
hr {
  border-style: none;
  border-top-style: dotted;
  border-color: grey;
  border-width: 7px;
  width: 6%;
}
img {
    height: 200px;
}
h1 {
    color: #66BFBF;
}
h3 {
    color: #66BFBF;
}
here are the css file 
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title> magzwebsite </title>
    <link rel="stylesheet" href="css/style.css">
  </head>

这是 index.html 文件

【问题讨论】:

  • 你忘记了第 2 行的分号

标签: css


【解决方案1】:

您忘记了第一个参数末尾的分号身体选择器。

body {
    background-color: #b3e6ee;
}

这应该解决它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-20
    • 2023-03-20
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 2015-03-28
    相关资源
    最近更新 更多