首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

解决css的float父div没高度

2012-11-03 
解决css的float父div没有高度在做页面设计常会碰到css的float父div没有高度的情况,HTML代码设计view plain

解决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

热点排行