当前位置: 代码迷 >> Web前端 >> 各浏览器 hack归结
  详细解决方案

各浏览器 hack归结

热度:93   发布时间:2013-03-21 10:08:17.0
各浏览器 hack归纳
序号 适用浏览器 css代码
1 IE6 .hack { _background: #00f; } /*IE6*/
2 IE6、7 .hack {*background: #0f0; } /*IE6、7*/
3 IE7 .hack {*+background: #0f0; } /*IE7*/
4 IE7+、FF .hack {background: #0f0;!important } /*IE7+、FF*/
5 IE8+、Opera .hack { background: #f00\0; } /*IE8*/
6 IE9 .hack { background: #f00\9\0;} /*IE9*/
7 IE8、9 .hack { background: #f0f\0; } /*IE8、9*/
8 IE6+ .hack { background: #ff0\9; } /*IE6+*/
9 Opera @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { head~body .hack { background: #ccc; } } /*Opera*/
10 Webkit @media screen and (-webkit-min-device-pixel-ratio:0) { .hack { background: #f60; display: block; } } /* Webkit */
11 FireFox @-moz-document url-prefix() { .hack { background: #fff; } } /* Firefox */