DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Switch To Browserspecific Stylesheet

10.02.2006
| 211 views |
  • submit to reddit
        // use diferent css for different browsers
// switch with conditional comments

<html><head><title>Conditional CSS</title>
  <link rel="stylesheet" type="text/css" href="basis.css">

  <!-- firefox, ... -->
  <style type="text/css">@import url(modern.css) all;</style>

  <!--[if gte IE 6.0]>
    <style type="text/css">@import url(ie60+.css);</style>
  <![endif]-->

  <!--[if lt IE 6.0]>
    <style type="text/css">@import url(ie60-.css);</style>
  <![endif]-->

</head>
<body>
  <!-- HTML-Source -->
</body>
</html>