954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Google Chrome Stylesheet Missing

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

WebspoonUK
Newbie Poster
22 posts since Mar 2010
Reputation Points: 10
Solved Threads: 2
 

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.

drjohn
Posting Pro in Training
445 posts since Mar 2010
Reputation Points: 76
Solved Threads: 80
 

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

WebspoonUK
Newbie Poster
22 posts since Mar 2010
Reputation Points: 10
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: