我如何可以有一个CSS样式不同于IE6? [英] How can I have a CSS style different for IE6?

查看:115
本文介绍了我如何可以有一个CSS样式不同于IE6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个特定的CSS样式不同于IE6。基本上我使用CSS sprites与PNG文件。但对于IE6我想使用.gif版本。



我不想使用<! - if lte IE6 语句。





$ b

b

编辑:



我需要这个,因为我希望我的用户包括一个单独的CSS文件,而不是4行代码。我的用户是绝对的新手。我不想混淆他们。此外,我想要的唯一更改是使用.gif而不是当前的.png。






编辑:



_background-image:如何?有什么问题吗?

或者,我可以在CSS文件中使用条件语句吗?

解决方案

如果您不想使用条件注释,则可以使用* html hack:

  h1 {
color:green;
}

* html h1 {
color:red; / *这将只适用于IE 6,5.5,5和4 * /
}


I want to have a particular CSS style different for IE6. Basically I am using CSS sprites with a PNG file. But for IE6 I want to use the .gif version.

I dont want to use the <!-- if lte IE6 statement. I want to include it within my CSS file itself.

How do I do that?


Edit:

I need this because I want my users to include a single CSS file and not 4 lines of code. My users are absolute newbies. I don't want to confuse them. Plus the only change I want is to use .gif instead of the current .png.


Edit:

How does _background-image: sound? Is there anything wrong with that?
Alternatively, can I use a conditional statement inside a CSS file?

解决方案

If you don't want to use conditional comments, then you can use the * html hack:

h1 {
    color: green;
}

* html h1 {
    color: red; /* this will only be applied by IE 6, 5.5, 5, and 4 */
}

这篇关于我如何可以有一个CSS样式不同于IE6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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