在做页面设计常会碰到css的float父div没有高度的情况,HTML代码设计

<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}

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案