tags:

views:

284

answers:

3

how do call specific css for specific browser using jquery

+1  A: 

Documentation on coding browser specific for jQuery.

I'm not sure what you mean by specific css, but here's an example getting the browser and then using CSS selectors to show those classes.

if(jQuery.browser.msie) {
  $('.myspecificcssclass').show();
}

Generally, you shoudn't need to do this, but...

altCognito
"Deprecated in jQuery 1.3", meaning it might be dropped from a future release. A better solution is to use the jQuery.support properties, like boxModel and cssFloat. It'll give you better control.http://docs.jquery.com/Utilities/jQuery.support
Plutor
A: 

This is what you're looking for: CSS Browser detection using jQuery

<code>
#myInput{background:black;} .browserSafari
#myInput{background:black; position:relative; top:2px;} 
</code>

//example calls specific css for Safari:
TStamper
A: 

its not longer done by browser sniffing in jQuery 1.3+, but by support it has for several things like right W3C box model support, ect.

see - jQuery.support for further reading on the subject in the API.

vsync