根据css3.info的selector test,Firefox 3.0支持第n个子选择器的一些排列。但是,显示的代码here(#30)不适用于我。Firefox的CSS3“nth-child”支持?
它应该选择空段落,所以我编辑我的代码到以下,但它不显示在Firefox(它在Opera中工作)。
<style type="text/css">
div :nth-child(even) {
background-color: yellow;
height: 30px;
}
</style>
<div>
<div>Does this element match?</div>
<div></div>
<div>Does this element match?</div>
<div></div>
</div>
这是测试中的错误还是我在某处发生了错误?
已验证 - Safari 3代码有效。 FF 3它没有。 div与div之间也有区别:nth-child(偶数)和div:n-child(偶数) – 2009-04-10 17:21:39
我刚刚测试了3.0.8,结果如下:nth-child()(88中有47个失败)。 其中包括:n-child(偶数) – 2009-04-10 17:22:05