当前位置: 代码迷 >> HTML/CSS >> 解决css的float父div没高度
  详细解决方案

解决css的float父div没高度

热度:121   发布时间:2012-11-03 10:57:42.0
解决css的float父div没有高度
在做页面设计常会碰到css的float父div没有高度的情况,HTML代码设计
view plaincopy to clipboardprint?
<div class='box'> 
<div class='float_left'></div> 
<div class='float_right'></div> 
</div> 
在CSS里定义了如CLASS类这样的浮动后,你会发现父div名box没有高度,所以又时候你可能感觉到父div的margin没有效果,这种情况下,你只需要给父div加个overflow:hidden就可以了,譬如
.box{overflow:hidden} 

W3C OVERFLOW
  相关解决方案