When child divs are floated, parent divs lose auto-height

天涯浪子 提交于 2019-12-03 09:50:53

Contain your floats.

On the div called main add overflow:hidden;. That should contain it.

Are you using relative positioning for your floats?

You'll need to put a fake div in to "hold open" the parent div otherwise. As soon as everything is floated you will lose all basis for height in the parent div. (Nothing is in there.)

inserting "overflow:hidden;" into parent div worked for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!