开发者

IE conditional statements do not work with JavaScript disabled?

I have a page with IE conditional comments in head section, nothing fancy just:

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

It works as expected when JavaScript is on. When JS is off IE doesn't seem to read IE7.css though. I wanted to make my site able to run with or without JS, validate and all and wanted to avoid CSS ha开发者_Python百科cks at all costs hence conditional comments.

Could someone with more experience with conditional comments and JS-off tell me if there is any way at all to get conditional statements work without JS?


I was just about to post the code when I realized that I forgot to update links when copied my html templates into framework I created and so the code I pasted above should actually be:

<!--[if IE 7]>
    <link rel="stylesheet" href="templates/<?php echo Registry::getVariable("theme") ?>/css/findadsIE7.css" type="text/css" />
<![endif]-->

Embarassing mistake and now all works just fine. I was too fast to blame microsoft this time ;)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜