PDA

View Full Version : Conditional hacks



jwalker80
30 Apr 2007, 07:12 AM
Hi,

Im sure this is a common question, I searched and I havent been able to find a way around it yet...


I want to get the css to ignore IE or Firefox.

I dont want to change any of the HTML, for example inserting [if IE] statments.

I have tried * html div# ... but this doesnt work for IE7, as far as i can see

I have tried the ! important also but this does not work for IE7 either

Is there a work around for getting the css to ignore all versions of IE or Firefox by editing the CSS only ?

Wickham
30 Apr 2007, 07:35 AM
Not by using CSS.

You can use a javascript browser sniffer and set different stylesheets for different browsers, but I don't know the code.

As you say, the available hacks and conditional comments in CSS work for IE but generally not for other browsers.

See http://www.wickham43.supanet.com/tutorial/generaladvice.html#conditionalcomments
in the last few paragraphs.

You can use > as in li>p which will work in CSS compliant browsers ie IE7 AND Firefox but I'm not sure which other browsers fall into this category (definitely not IE6).