How do I import an css file for Chrome (or webkit).
I want to do something like this for ie6:
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
How do I import an css file for Chrome (or webkit).
I want to do something like this for ie6:
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
Your best, and easiest, bet is using a server-side language that can detect the user's browser. PHP, ColdFusion, JSP, etc have built-in functions and variables that can help you determine the browser a user has.
If not, then a client-side scripting agent is your next option. JavaScript, and its efficient library option, jQuery, are good approaches.
//jQuery
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
if ($.browser.webkit) {
///Chrome-specific css here.
}
</script>
If you can't (or don't know how to) use the library, then the following works as well, but you'll need to do a few more conditional checks
//Javascript (Note: Chrome will say 'Netscape' for its name)
<script>
var browserName = window.navigator.appName;
var browserVersion = window.navigator.appVersion;
</script>
if you want to only change lines of code instead load a full css file you could use this: http://rafael.adm.br/css_browser_selector/