【IE6雙倍邊距】-IE6雙倍邊距的bug

效果css


代碼spa

  
  
  
  
CSS IE6雙倍邊距的bugbody { margin: 0; padding: 0; }.div1 { width: 200px; height: 200px; background: red; margin-top: 20px; margin-left: 20px; float: left; display: inline; }.div2 { width: 300px; height: 200px; background: blue; float: left; }bug描述:兩個div元素浮動的時候,當設置 margin-left: 20px; IE6下面將會呈現40px浮動的影響將會把div層從文檔流中給拖出來,只有在浮動以後清除掉浮動,才能迴歸原來的文檔流中div向左邊浮動20個像素時,ie6下這個值將會加倍,解決的方法是/*display: inline; */
代碼分析




附件列表

相關文章
相關標籤/搜索