NinGen ShinRa
我使用CSS已有很长时间了,我认为我很了解特殊性,但是这个例子使我感到困惑。已经很晚了,所以我可能会遗漏一些明显的东西:
.class span {
color: blue;
}
section#id {
color: beige;
}
<div class="class">
<section id="id">
<span>Test</span>
</section>
</div>
的特异性为section#id
101,而的特异性为.class span
11,最重要的是,第二条规则甚至在第一个规则之后指定。
我想念什么明显的东西?
基督教
您没有使用第二个选择器定位范围。颜色将仅级联到color属性设置为inherit
(默认)的元素。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
编辑于
我来说两句