【发布时间】:2014-02-05 16:15:19
【问题描述】:
nth-match 应该按照以下方式在 jsfiddle 中工作
:nth-match(even of p,h3) {text-decoration: underline;}
这应该在p 和h3 元素的每一秒下划线。但是,它不起作用 - 无论是在 FF 还是在 Chrome 中:
问题出在哪里?
【问题讨论】:
-
似乎还没有浏览器支持它css4-selectors.com/selector/css4/structural-pseudo-class。请参阅下面的
Browser support部分 -
这是一个非常新的 CSS4 伪类,目前还没有任何浏览器真正支持。规格:w3.org/TR/selectors4/#the-nth-match-pseudo
-
将示例中的代码从上面的链接从@LostInComputer (css4-selectors.com/selector/css4/structural-pseudo-class) 更改为
nth-of-type,如下所示从@tomsullivan1989 (p:nth-of-type) 在 FF 26、Chrome 32 和 IE9 中创建了一个工作示例
标签: html css css-selectors