<分区>
标签 html css css-selectors
<分区>
为什么不能在 CSS 中使用数字,还有其他方法吗?我有以下代码:
<div class="center 400-width" id="position">
<div class="" id="header">
Header
</div>
<div class="" id="content">
Content
</div>
<div class="" id="footer">
Footer
</div>
</div>
CSS 选择 400-width
类,这意味着容器的宽度为 400px
。 background-color
用于检查是否为真。
.400-width{
width:400px;
background-color:blue;
color:white;
}
如您所见here 现在不会发生
我通过将 400-
替换为 four
解决了这个问题。所以它变成了 fourwidth
。
最佳答案
我也遇到过同样的问题....其实这不是问题..
使用“.width-400”代替“.400-width”
关于html - CSS 无法选择其中包含数字的类/id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18440730/