码迷,mamicode.com
首页 > Web开发 > 详细

CSS中识别各类IE的方法

时间:2016-09-30 18:08:33      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

IE6 only:

* html .ie6 {
    property: value;
}

or

html .ie6 {
    _property: value;
}

 

IE7 only:

*+html .ie7 {
    property: value;
}

or

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

 

IE6 and IE7:

@media screen\9 {
    ie67 {
    property: value;
    }
}

or

.ie67 {
    *property: value;
}

 

IE6,7 and IE8:

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

 

IE8 only:

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

or

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

 

IE8(只在标准模式):

.ie8 {
    property/*\**/: value\9;
}

 

IE8,9 and IE10:

@media screen\0 {
    ie8910 {
        property: value;
    }
}

 

IE9 only:

@media screen and (min-width:0\0) and (min-resolution: .001dpcm) {
    /*IE9 CSS*/
    .ie9{
        property: value;
    }
}

 

IE9+:

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

 

IE9 and 10:

@media screen and (min-width:0) {
    .ie910 {
        property: value;
    }
}

 

IE10 only:

_:-ms-lang(x), ie10 {
    property: value;
}

 

IE10+:

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

or

@media all and (-ms-high-contrast:none), (-ms-high-contrast:active) {
    .ie10up {
        property: value;
    }
}

 

IE11+:

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

 

CSS中识别各类IE的方法

标签:

原文地址:http://www.cnblogs.com/hdywm/p/5924240.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!