开发者

Conditional comments for IE, are also visible to Firefox

开发者 https://www.devze.com 2023-02-01 23:23 出处:网络
What\'s the matter with my conditional comments? They apply bo开发者_JAVA百科th to firefox and IE!

What's the matter with my conditional comments? They apply bo开发者_JAVA百科th 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?


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.


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" />
0

精彩评论

暂无评论...
验证码 换一张
取 消