日期:2014-05-17  浏览次数:20608 次

ie绝对定位bug
<div id="layer1" style="margin:20px; border:1px solid #F88; width:400px; ">
  <div id="layer2" style="position:absolute; background-color:#ccc;">Absolute</div>
  <div id="layer3" style=" margin:30px auto;width:200px; height:80px; background-color:#36F;">Normal</div>
</div>


这个是什么原因。ie6,7和ff下不一样

------解决方案--------------------
HTML code
<div id="layer1" style="margin:20px; border:1px solid #F88; width:400px; position:relative;">
  <div id="layer2" style="position:absolute; left:0; top:0; background-color:#ccc;">Absolute</div>
  <div style="height:0; overflow:hidden;"></div>
  <div id="layer3" style="margin:30px auto; width:200px; height:80px; background-color:#36F;">Normal</div>
</div>

------解决方案--------------------
http://www.blueidea.com/tech/web/2007/4577.asp
------解决方案--------------------
我也想知道原理