CSS浏览器兼容性相关
浏览器兼容性
.all IE{property:value\9;} .gte IE 8{property:value\0;} .IE 8/9{property:value\0;} .lte IE 7{*property:value;} .IE 9{property:value\9\0;} /*仅IE9支持*/ .IE 7{+property:value;} .IE 6{_property:value;} .not IE{property//:value;}
text-indent在IE6/IE7中的位置偏移BUG
text-indent一般用来实现文字缩进,不过更多的时候是用来实现文字隐藏。发现在IE6/IE7中,text-indent会导致inline- block元素出现向左(text-indent的值为负时)或向右(text-indent值为正时)的偏移。
inline-block元素设置text-indent在IE6/IE7中不正常,在IE8中正常。造成这种情况的原因应该是IE6/IE7并没有真正实现inline-block, 而是通过设置display:inline-block触发了IE的layout, 从而使内联元素拥有了inline-block属性的表症。
解决方法:
.element {display:inline-block; *display:block;}