WebKit中的错误::对不存在的元素的最后子规则导致:nth-​​child浩劫

时间:2011-08-27 18:15:41

标签: html css google-chrome safari webkit

如果last-child标记不包含任何td标记时,所有tr标记都应用空nth-child规则,则tr:nth-child(odd) td { background: #27d; } tr:last-child td:last-child { } 规则未正确应用。

例如,这个CSS:

<table> 
    <tr><th colspan="10"></th></tr>
    <tr><td></td>[10 times]</tr> 
    <tr><td></td>[10 times]</tr> 
    ...
</table> 

使用此HTML:

{{1}}

在Firefox 5.0.1中正常工作(它可以打印蓝线和白线)和Safari 5但在Safari 5.1和Chrome 13.0.782.215中不能正常工作:

Strange behavior in WebKit

http://www.jill-jenn.net/drafts/zebra-striping/

更令人惊讶的是:当您嵌入CSS代码而不是链接到它时,WebKit中的行为是不同的。

Another strange behavior in WebKit

http://www.jill-jenn.net/drafts/zebra-striping/nolink.html

我已经在Apple的Bug Reporter上买了一张票,但我想知道是否有人发现了类似的东西。

0 个答案:

没有答案