关于ie6下的双倍浮动

上例子:

<div clss="test1" style="float:left;margin-left:50px; 50px;height50px;background:red;"></div>
<div clss="test2" style="float:left;margin-left:50px; 50px;height50px;background:red;"></div>
上述例子中:test1就会产生双倍浮动,而test2则不会,这说明了你设置了浮动距离后,如果前面也有浮动元素,那么就不会产生双倍浮动。
所以可以通过设置margin-right来避免产生双倍浮动,
<div style="padding-left:50px;">
  <div clss="test2" style="float:left;margin-right:50px; 50px;height50px;background:red;"></div>
  <div clss="test2" style="float:left; 50px;height50px;background:red;"></div>
</div>
如果你实际运用要用到margin-left的话,可以在浮动元素添加display:inline属性来避免双倍浮动。
原文地址:https://www.cnblogs.com/Qzhou/p/3135118.html