【问题标题】:If ie conditional tag not working in ie9?如果 ie 条件标签在 ie9 中不起作用?
【发布时间】:2013-08-05 13:04:37
【问题描述】:

我正在制作一个网站,我想要一个不同的样式表。 在 ie 8 上它的工作完美,但 ie9 似乎没有得到它。

我尝试了几种说法,比如

if lte IE 10

if IE

if IE 9

现在我发现了这个问题:Conditional Comments not working in IE9 (CF environment)

以下也无法正常工作

if gte IE 7

我只是不知道我做错了声明是正确的,因为它在 ie8 中确实有效..

完整的声明是:

<!--[if gte IE 7]>
<link href="<?php echo bloginfo('template_directory'); ?>/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

【问题讨论】:

    标签: internet-explorer conditional


    【解决方案1】:

    尝试相同但没有 CC 注释(即插入链接标签而不在 CC 中换行)。

    可能您的问题在于从服务器接收到的 MIME 类型(IE9 错误)。

    【讨论】:

    • 对。发生这种情况是因为您的服务器发送了错误的 MIME 类型的 CSS 文件。这是IE9中的一个错误。 IE9 无法识别 mime,即使它在 type 属性中设置。您必须在服务器设置中设置正确的 mime 类型。如果是 Apache,请在 .htaccess 中添加以下字符串(不带引号)“AddType text/css .css”
    猜你喜欢
    • 2019-02-11
    • 1970-01-01
    • 2011-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多