IE9中的条件样式表 [英] Conditional Style Sheets in IE9

查看:61
本文介绍了IE9中的条件样式表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE9应该支持条件注释.我具有正确的MIME类型:'type ="text/css"'.所有其他条件样式表都将被读取到正确的浏览器中.

IE9 is supposed to support conditional comments. I have the correct MIME type: 'type="text/css"'. All of the other conditional style sheets are being read into the correct browsers.

这是我无法阅读的内容:

Here is what I cannot get to read in:

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

其余部分都在头部,但在IE9中不会显示在头部.

It is in the head with the rest of them, yet will not show up in the head in IE9.

推荐答案

抱歉,您的问题很愚蠢,但是,您是否清除了缓存并进行了测试(尝试设置一些边框颜色)? CSS文件路径是否正确且可通过您的http服务器访问(尝试使用浏览器打开它,并测试它是否在没有条件语句的情况下工作)? 另一件事,我会选择gte(大于或等于).

Sorry for the dumb questions but, have you cleared the cache and tested (try setting some border-color or something)? Is the css file path correct and accessible through your http server (try opening it with your browser and testing if it works without the conditional statement)? Another thing, I would go with gte (greater than or equals).

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

还要检查是否有与X-UA兼容的元标记,这些标记与他们通常的猴子业务无关(与条件语句无关,但最近似乎是许多弊端的根源).

Also check it there is none X-UA-Compatible meta tags around doing their usual monkey business (Nothing to do with conditional statements, but seems to be the root of many evils lately).

这篇关于IE9中的条件样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆