mister
mister

Reputation: 41

CSS first-child

Is it safe to use CSS pseudo class first-child with regards to browser support and the like?

Thanks.

Upvotes: 4

Views: 1195

Answers (5)

delphi
delphi

Reputation: 11115

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

http://selectivizr.com/

Upvotes: 0

xentek
xentek

Reputation: 2645

jQuery would be another option to solve this cross browser.

Upvotes: 0

SpliFF
SpliFF

Reputation: 38956

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

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

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.

Upvotes: 2

cletus
cletus

Reputation: 625027

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.

Upvotes: 6

dagoof
dagoof

Reputation: 1139

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.

Upvotes: 1

Related Questions