这两天在做一个页面遇到DIV布局高度自适应的问题,IE6默认是自适应高度的,火狐和IE7 并不是 需要进行设置才可以
解决方案如下:
<style type="text/css"> .out { width:500px; height:100px; background:#000000; } .in { width:200px; height:200px; float:left; background:#eecc33; } </style> <div class="out"> <div class="in"></div> </div> |
在<div class="in"></div>下面加一行:<div style="clear:both;"></div>(火狐成功)
.out 的Height:auto;IE7成功