Skip to content

Instantly share code, notes, and snippets.

@folksilva
Created June 1, 2012 18:27
Show Gist options
  • Save folksilva/2854199 to your computer and use it in GitHub Desktop.
Save folksilva/2854199 to your computer and use it in GitHub Desktop.
JQuery Browser Specific CSS Example
<html>
<head>
<!-- Title, meta, jquery 1.4+ etc... -->
<script>
var browser = $.browser;
if(browser == "webkit"){
$("head").append('<link rel="stylesheet" href="safari_or_chrome.css" type="text/css" >');
}else if(browser == "msie"){
$("head").append('<link rel="stylesheet" href="internet_explorer.css" type="text/css" >');
}else if(browser == "mozilla"){
$("head").append('<link rel="stylesheet" href="firefox_or_derived.css" type="text/css" >');
}else if(browser == "opera"){
$("head").append('<link rel="stylesheet" href="opera.css" type="text/css" >');
}else{
$("head").append('<link rel="stylesheet" href="other_or_unknown.css" type="text/css" >');
}
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment