You can use any of the following scripts to select css files for IE and other browser:

1. For all IE versions:

<!–[if IE]>
<link rel=”stylesheet” type=”text/css” href=”style_ie.css” />
<![endif]–>

2. For all browsers except IE:

<!–[if !IE]><!–>
<link type=”text/css” rel=”stylesheet” href=”style.css”>
<!–<![endif]–>

3. For a particular IE version use following code:

Syntax: <!–[if IE <version-code>]>

Example:

<!–[if IE 6]>
<link rel=”stylesheet” type=”text/css” href=”style_ie.css” />
<![endif]–>

Incoming search terms:

  • how to put condition in css

Filed under: BrowsersHTML & CSS

Like this post? Subscribe to my RSS feed and get loads more!