2

Is the following CSS syntax valid?

a:first-child:hover { background-color: transparent; }

If so, what is the compatibility as far as browsers? For example, is it compatible in IE8, IE6+, Firefox 4, Chrome, etc.

1 Answer 1

5

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>

2
  • Yes it works but also take a look here
    – Alex Char
    Commented Dec 6, 2014 at 13:45
  • 1
    This isn't so much an issue of IE6 not recognizing multiple pseudo-classes in a chain as that it doesn't recognize :first-child. It does sound like a reasonable claim, though.
    – BoltClock
    Commented Dec 7, 2014 at 16:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.