CSS first child

Is it possible to use the first alias of the CSS pseudocom class with respect to browser support, etc.

Thanks.

+4
source share
5 answers

Depends on that browser.

IE6 does not support it. See : first-child and: last-child :

Explorer 6- on Windows is not supported.

Explorer 7, Safari 3.0, iCab only support: first child.

+6
source

You can support CSS2 pseudo-classes in IE5 / IE6 using the Dean Edwards IE7 JS library

http://dean.edwards.name/IE7/

It is free, easy to use and highly recommended. Just enter the following code into 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 never caused me any problems, and it solves a number of problems with IE6 lameness.

+2
source

According to w3, it is supported by all major browsers (e.g. firefox, opera, chrome, safari) with the warning that for: the first child to work in ie, a <DOCTYPE> must be declared.

+1
source

jQuery will be another option for solving this cross browser.

0
source

You can support IE6-8 with selectivizr. It works very well.

http://selectivizr.com/

0
source

Source: https://habr.com/ru/post/1302831/


All Articles