小编Mar*_*cel的帖子

如何为IE设置特殊的CSS?

我想为ie8使用一些不同的CSS,但只保留一个CSS文件.谁能告诉我这个最好的"黑客"是什么?是的,我知道黑客不好,但我想保留一个CSS文件,至少目前.

例如,在非IE8浏览器中,我希望浏览器看到这个:

div.content_header_heading { 
    background: -moz-linear-gradient(top, #cccccc 0%, #eeeeee 35%, #eeeeee 65%, #cccccc 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cccccc), color-stop(35%,#eeeeee), color-stop(65%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #cccccc 0%,#eeeeee 35%,#eeeeee 65%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #cccccc 0%,#eeeeee 35%,#eeeeee 65%,#cccccc 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 35%,#eeeeee 65%,#cccccc 100%); /* IE10+ */
}
Run Code Online (Sandbox Code Playgroud)

但如果浏览器是IE8,我希望浏览器看到这个:

div.content_header_heading { 
}
Run Code Online (Sandbox Code Playgroud)

html css internet-explorer

6
推荐指数
1
解决办法
4563
查看次数

标签 统计

css ×1

html ×1

internet-explorer ×1