IE6对CSS支持Bug收集

1、IE6双外边距

  在IE6下,如果对元素设置了浮动,同时又设置了margin-left或者margin-right,margin值会加倍。

  例如,设置margin-left:10px在IE6下会显示为margin-left:20px。

  解决这个Bug的办法就是设置display:inline。

2、有时候border会断开,刷新页面或者滚动滚动条的时候,断掉的部分又会连接起来

  这与IE下的一个神秘的属性相关——hasLayout。hasLayout是IE浏览器专有的一个属性,用于CSS的解析引擎。有时候在IE下一些复杂的CSS设置解析起来会出现Bug,其原因可能与hasLayout没有被自动触发有关,我们通过一些技巧,手动触发hasLayout属性可以解决Bug了。

  解决:使用“zoom:1”,在使用DHTML的时候,如果还无效,还要加上“position:relative”。

3、用iframe解决IE 6 下select与浮起元素的显示Bug

<style type="text/css">
    #test{200px;height:200px;background:green;position:absolute;left:50px;top:10px;z-index:2;}
    #testMask{200px;height:200px;position:absolute;left:50px;top:10px;z-index:1;}
</style>

<select><option>-请选择-</option></select>
<div id="test"></div>
<iframe id="testMask" frameborder="0" scrolling="no"></iframe>
原文地址:https://www.cnblogs.com/lhl98/p/3425746.html