我正在尝试让自定义 404 页面在我的网站上正常工作,但 CSS 无法正常工作。
CSS:
#404-container{
text-align: center;
}
.404-item{
text-align: center;
}
HTML:
<div id="404-container">
<h1 class="404-item">404</h1>
<h3 class="text-format-italic 404-item">The requested page could not be found</h3>
</div>
Firefox 控制台显示:
预期的选择器。由于错误的选择器而忽略了规则集。
两次。
最佳答案
啊哈!请永远不要以数字开头您的类(class)和 ID。这是最佳编程实践。您甚至永远不能以数字开头变量名。
将其更改为:
#four04 {
...
}
关于html - 错误的 Css 选择器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23026876/