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

  • 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>

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

  <!-- HTML-Source -->