原文请看:http://beyondweb.cn/
.content .test {
width
:
200px
;
height
:
200px
;
background
:
#f60
;
/*all*/
background
:
#06f9
;
/*IE*/
*
background
:
#666
;
/*IE6,7*/
_background
:
#ccc
;
/*IE6*/
}
/* webkit and opera */
@media
all
and (
min-width
:
0
){
.content .test {
background
:
#0f0
;
}
}
/* webkit */
@media
screen
and (-webkit-min-device-pixel-ratio:
0
) {
.content .test {
background
:
#ff0
;
}
}
/*FireFox*/
@-moz-document url-prefix() {
.content .test {
background
:
#f0f
;
}
}
/*IE9+*/
@media
all
and (
min-width
:
0
) {
.content .test{
background
:
#f009
;
}
}
/*IE10+*/
@media
screen
and (-ms-high-contrast: active), (-ms-high-contrast:
none
) {
.content .test {
background
:
#0ff
;
}
}
本文介绍了一种通过CSS hack技术实现跨浏览器兼容性的方法,针对不同浏览器版本提供了特定样式解决方案,包括IE6到IE10及现代浏览器如Chrome、Firefox和Opera。

525

被折叠的 条评论
为什么被折叠?



