css hack

来源:互联网 发布:上海博物馆淘宝 编辑:程序博客网 时间:2024/04/19 07:02
原文请看: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 alland (min-width:0){
    .content .test {
        background:#0f0;
    }
}
    
/* webkit */
@media screenand (-webkit-min-device-pixel-ratio:0) {
    .content .test {
        background:#ff0;
    }
}
    
/*FireFox*/
@-moz-document url-prefix() {
    .content .test {
        background:#f0f;
    }
}
    
/*IE9+*/
@media alland (min-width:0) {
    .content .test{
        background:#f009;
        }
}
    
/*IE10+*/
@media screenand (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .content .test {
        background:#0ff;
    }
}