The code below shows a couple example of how you can include conditional stylesheets based on the client’s browser. There are many other ways besides this but this examples shows a couple approaches
The Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<!--[if IE]> <link rel="stylesheet" type="text/css" href="iestyles.css" /> <![endif]--> <!--[if IE 9]> <link rel="stylesheet" type="text/css" href="ie9.css" /> <![endif]--> <script type="text/javascript"> var detect = navigator.userAgent.toLowerCase(); if (checkIt('safari')){ document.write('<link rel="stylesheet" type="text/css" href="safari.css" />'); } function checkIt(string){ var place = detect.indexOf(string) + 1; return place; } </script> |