单个选择器上的多个伪类 [英] Multiple Pseudo Classes on a Single Selector
本文介绍了单个选择器上的多个伪类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下CSS语法有效吗?
Is the following CSS syntax valid?
a:first-child:hover { background-color: transparent; }
如果是,那么与浏览器的兼容性如何?例如,它与IE8,IE6 +,Firefox 4,Chrome等兼容吗?
If so, what is the compatibility as far as browsers? For example, is it compatible in IE8, IE6+, Firefox 4, Chrome, etc.
推荐答案
组合第一个孩子
和:hover
是正确的(IE6仅识别链):
Combo first-child
and :hover
is correct(IE6 recognize only last pseudo-class in the chain):
div span:first-child:hover {
color: red;
}
<div>
<span>asdasd</span>
<span>asdasd</span>
<span>asdasd</span>
</div>
这篇关于单个选择器上的多个伪类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文