表格1 选择器hack
选择器hack写法 | 针对的浏览器 |
@media screen\9 {body { background: red; } } | 只对IE 6、7有效 |
@media \0screen {body { background: red; } } | 只对IE8有效 |
@media\0screen\, screen\9 {body { background: red; } } | 只对IE 6、7、8有效 |
@media screen\0 {body { background: red; } } | 只对IE8、9、10有效 |
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {body { background: red; } } | 只对IE10有效 |
表格2 属性hack
CSS属性hack | 针对的浏览器 |
_color: red; | IE6及其以下版本 |
*color: red; 或者 +color: red; | IE7及其以下版本 |
color: red\9; | IE 6、7、8、9、10 |
color: red\0; | IE8、9、10 |
color: red\9\0; | IE9、10 |
color: red!important; | IE7、8、9、10及其其他非IE浏览器 |