How to avoid empty clear divs?

后端 未结 5 2157
半阙折子戏
半阙折子戏 2021-01-03 07:34

I have been using a lot of floats recently like this:

5条回答
  •  旧时难觅i
    2021-01-03 08:05

    As long as you define the overflow of the parent, it will clear all floats.

    Use overflow:auto on the parent, and your good to go!

    http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/

    (I have heard this works using display:inherit as well, but have not tried.)

提交回复
热议问题