您的位置:首页 > 其它

ie11媒体查询以及其他hack

2016-08-02 15:39 267 查看
<!doctypehtml>
<html>
<head>
<title>IE10/11MediaQueryTest</title>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible"content="IE=edge">
<style>
@mediaalland(-ms-high-contrast:none)
{
.foo{color:green}/*IE10*/
*::-ms-backdrop,.foo{color:red}/*IE11*/
}
</style>
</head>
<body>
<divclass="foo">HiThere!!!</div>
</body>
</html>


IE6

*html.ie6{property:value;}


downvote
Inthelightoftheevolvingthread,Ihaveupdatedthebelow:

IE6

*html.ie6{property:value;}or

.ie6{_property:value;}
IE7

*+html.ie7{property:value;}
or

*:first-child+html.ie7{property:value;}
IE6and7

@mediascreen\9{
.ie67{property:value;}
}
or

.ie67{*property:value;}
or

.ie67{#property:value;}
IE6,7and8

@media\0screen\,screen\9{
.ie678{property:value;}
}
IE8

html>/**/body.ie8{property:value;}
or

@media\0screen{
.ie8{property:value;}
}
IE8StandardsModeOnly

.ie8{property/*\**/:value\9}
IE8,9and10

@mediascreen\0{
.ie8910{property:value;}
}
IE9only

@mediascreenand(min-width:0\0)and(min-resolution:.001dpcm){
//IE9CSS
.ie9{property:value;}
}
IE9andabove

@mediascreenand(min-width:0\0)and(min-resolution:+72dpi){
//IE9+CSS
.ie9up{property:value;}
}
IE9and10

@mediascreenand(min-width:0\0){
.ie910{property:value\9;}/*backslash-9removesie11+&oldSafari4*/
}
IE10only

_:-ms-lang(x),.ie10{property:value\9;}
IE10andabove

_:-ms-lang(x),.ie10up{property:value;}
or

@mediaalland(-ms-high-contrast:none),(-ms-high-contrast:active){
.ie10up{property:value;}
}
IE11(andabove..)

_:-ms-fullscreen,:root.ie11up{property:value;}


原文地址http://stackoverflow.com/questions/20541306/how-to-write-a-css-hack-for-ie-11

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: