2014-12-06 7 views
2

다음 CSS 구문이 유효합니까?단일 선택기의 다중 의사 클래스

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

그렇다면 브라우저와의 호환성은 무엇입니까? 예를 들어, (IE6 체인 만 마지막 가상 클래스를 인식) first-child:hover이 올바른지 등 IE8, IE6 +, 파이어 폭스 4, 크롬,

답변

5

콤보 호환이다

div span:first-child:hover { 
 
    color: red; 
 
}
<div> 
 
    <span>asdasd</span> 
 
    <span>asdasd</span> 
 
    <span>asdasd</span> 
 
</div>

+0

IE8에서 작동합니까? –

+0

네, 작동하지만 또한보십시오 [여기] (https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child#Browser_compatibility) –

+0

이것은별로 문제가되지 않습니다. IE6는': first-child'를 인식하지 못하는 체인에서 여러 개의 가상 클래스를 인식하지 못합니다. 그래도 합리적인 주장처럼 들립니다. – BoltClock