views:

68

answers:

4

I'd like to use css pseudo-selectors ( parent > child, element:first-child ) in my stylesheet but IE6 doesn't seem to recognize those. Is there any plugin (jQuery preferably) that would allow me to use pseudo-selectors freely without worrying about the damned IE6?

Thanks

+3  A: 

UPDATED:

The Super Selectors jQuery plugin scans the page's styles for selectors which aren't supported by all browsers and then adds apropriate classes to elements that those CSS3 selectors are targeting.

You can also look at this CSS3 pseudo selectors for IE5/IE8 called ie-css3.js

aSeptik
I already use jQuery (which comes with sizzle), but I want something that would allow me to use pseudo-selecotors freely on my css stylesheet.
Nimbuz
see my updates! ;-)
aSeptik
+2  A: 

I'd recommend against using javascript to fix those kind of problems.

The best approach I've found is using conditional comments and create a IE only CSS file, optimized for that hellish browser.

In the long run, the small duplication of work is compensated by the smaller amount of incompatibilities that you'd have to correct between sane browsers and IE.

voyager
+2  A: 

As a rule, I go with adding classNames to the body tag via conditional comments as my preferred method to deal with cross-browser difficulties.

However, if that's out and if performance is not a concern, you can always give Dean Edwards's excellent IE7.js a try. It will parse and grok your stylesheet, picking out and implementing those unsupported selectors.

Beware that, as your stylesheets increase and size and complexity, the script's (and your site's) performance will suffer in IE6. However, in a lot of cases things should run just fine. Make sure to conditionally comment it in for IE6 and below and you'll be set.

ajm
A: 

ie7 js or DOMassistant

Knu
So if I just include DOMassistant on my page, I can use pseudo-selectors freely in my css stylesheet?
Nimbuz
apparently yes check their doc http://www.domassistant.com/documentation/domassistant-documentation.pdf // you could also try ie-css3.js http://www.keithclark.co.uk/labs/ie-css3/ // ah nvm youv already accepted another answer
Knu