0

At the top of my classic asp page, I have a the following code to select the relevant stylesheet depending on which browser is being used: -

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="../styles/main-ie6.css" /><![endif]-->
<!--[if gt IE 6]><link href="../styles/main.css" rel="stylesheet" type="text/css" />
<!--[else]><link href="../styles/main.css" type="text/css" rel="stylesheet" /><![endif]-->

The problem is that when the site is loaded in Google Chrome, no stylesheet is picked up.

Does anyone know how to get round this?

Many TIA

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by WebspoonUK
0

Only IE can read conditional statements, so you do not put the default css file in there, you put if before the conditional statement, and then bits in the css file loaded by IE will override the same bits in the default file.

<link href="../styles/main.css" type="text/css" rel="stylesheet" />

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../styles/main-ie6.css" /><![endif]-->

Every other browser will get main.css, and ie6 alone will get main-ie6.css

simples.

Edited by drjohn: n/a

0

Only IE can read conditional statements, so you do not put the default css file in there, you put if before the conditional statement, and then bits in the css file loaded by IE will override the same bits in the default file.

<link href="../styles/main.css" type="text/css" rel="stylesheet" />

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../styles/main-ie6.css" /><![endif]-->

Every other browser will get main.css, and ie6 alone will get main-ie6.css

simples.

Thanks man

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.