【问题标题】:IE conditional comment not working [closed]IE条件注释不起作用[关闭]
【发布时间】:2012-02-16 05:28:08
【问题描述】:

我对 IE 的条件注释有点问题。

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

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

它在 IE9 中不起作用,IE9 加载普通样式表 (css/stil.css) 而不是我在条件注释中指定的样式表。请帮忙:)

【问题讨论】:

    标签: css internet-explorer conditional stylesheet comments


    【解决方案1】:

    IE9 加载普通样式表(css/stil.css),而不是我在条件注释中指定的样式表。

    从那句话中,听起来您并不希望 IE 下载并应用 css/stil.css 样式表。它应该而且将会。只是它应该下载并应用css/ie.css 样式表。会不会是您从 css/stil.css 看到了您意想不到的样式?从表面上看,the conditional comments work fine(在该示例中我必须使用style 而不是link 元素,但概念是相同的)。

    【讨论】:

    • 好的问题解决了我忘了我必须让 IE 忽略其他样式表所以这里是解决方案
    • @user1163539:没错。很高兴这有帮助。仅供参考,因为您是新来的:meta.stackexchange.com/questions/5234/…
    猜你喜欢
    • 2014-04-02
    • 1970-01-01
    • 1970-01-01
    • 2012-12-08
    • 1970-01-01
    • 2014-10-08
    • 2012-05-07
    • 2012-01-25
    • 1970-01-01
    相关资源
    最近更新 更多