你把IE条件放在css文件或html文件中吗? [英] Do you put IE conditionals in the css file or in the html file?

查看:118
本文介绍了你把IE条件放在css文件或html文件中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图把IE条件在一个CSS文件,但这似乎没有工作。有CSS的构造,所以你可以告诉它使用这个背景颜色,如果浏览器是IE?我也找不到任何东西,如果then else条件,它存在?有人可以提供一个例子。

解决方案

IE条件在HTML中,


$ b b b b $ b

 < head> 
< style type =text / css>
@import url(/styles.css);
< / style>
<! - [if lte IE 6]>
< link rel =stylesheettype =text / csshref =ie6.css/>
<![endif] - >
< / head>


I tried putting the IE conditional in a CSS file, but that didn't appear to work. Is there a construct for CSS so you can tell it to use this background color if the browser is IE? I also couldn't find anything on if then else conditionals, does it exist? Can someone provide an example.

解决方案

The IE conditional(s) go in the HTML, and should be used to include an additional CSS file that will overwrite CSS as needed for IE hacks.


Example:

<head>
    <style type="text/css">
    @import url(/styles.css);
    </style>
    <!--[if lte IE 6]>
        <link rel="stylesheet" type="text/css" href="ie6.css" />
    <![endif]-->
</head>

这篇关于你把IE条件放在css文件或html文件中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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