col*_*ass -2 html css stylesheet-link-tag
我无法链接我的CSS样式表:
层次:
index.html的:
// index.html
<!DOCTYPE html>
<html>
<head>
<link href="css/index.css" type="text/css" rel="stylesheet">
</head>
<body>
<p class="blue">Hello</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
index.css:
// index.css
.blue {
font:blue;
font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)
"font"属性不正确.
尝试替换这个:
.blue {
font:blue;
font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)
这样 :
.blue {
color:blue;
font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)
css路径似乎是正确的,您可以在浏览器控制台的网络选项卡上查看,如果您获得HTTP 200文件已加载,如果404找不到.