Hi
I have a CSS that applies different styles according to the browser, and I want to test for the browser (if browser is not IE) in the CSS file itself (not in the HTML or PHP file).
How can I do it? Should I use this:
<!--[if !IE]>
<style>
//code
</style>
<![end if]-->
in the CSS file???
These conditional comments are IE-only. So checking for !IE
won't do anything to other browsers ;)
You could inject the CSS with Javascript. I'm just improvising, something like this might do (jQuery):
if( !$.browser.msie ) {
$("#someLinkElement").attr( "href", "webkit.css" );
}
Edit: the condition holds for non-IE browsers now