zekia
zekia

Reputation: 4857

Conditional comments for IE, are also visible to Firefox

What's the matter with my conditional comments? They apply both to firefox and IE!

<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="../App_Themes/css/stylesIE7.css" />
<![endif]-->

Is this normal? Am I missing something?

Upvotes: 0

Views: 961

Answers (2)

Juraj
Juraj

Reputation: 192

In the source I see that you're including the stylesheets twice. Remove the last one.

    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="App_Themes/trimar/stylesIE7.css" />
<![endif]-->

<link href="App_Themes/trimar/styles.css" type="text/css" rel="stylesheet" />
<link href="App_Themes/trimar/stylesIE7.css" type="text/css" rel="stylesheet" />

Upvotes: 1

Pekka
Pekka

Reputation: 449485

If by "visible" you mean they are visible in the source code, that is as designed. But Firefox will not be loading the CSS file, but treat the whole section as a comment. The syntax you use is correct.

Use e.g. Firebug's "Net" tab to confirm that the style sheet is in fact not being loaded.

Upvotes: 2

Related Questions