Hello there.
Is it safe to use CSS pseudo class first-child with regards to browser support and the like?
Thanks.
Hello there.
Is it safe to use CSS pseudo class first-child with regards to browser support and the like?
Thanks.
Depends which browser.
IE6 doesn't support it. See :first-child and :last-child:
Not supported by Explorer 6- on Windows.
Explorer 7, Safari 3.0, iCab only support :first-child.
According to w3 it's supported by all major browsers (ie, firefox, opera, chrome, safari) with the caveat that for :first-child to work in ie, a < !DOCTYPE> must be declared.
You can support CSS2 pseudo-classes in IE5/IE6 by using Dean Edwards IE7 JS library
It's free, easy to use and highly recommended. Just put the following code in your HEAD:
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta2)/IE7.js"></script>
<![endif]-->
Despite the BETA label It's never given me any problems and it solves a whole range of IE6 lameness issues.