Float Creates Overlapping Divs

前端 未结 5 545
小鲜肉
小鲜肉 2021-02-05 20:43

I have two divs (one inside of the other) and am running into a bit of a problem when I float the one inside to \"left\". The problem is that the outer div doesn\'t expand its

5条回答
  •  后悔当初
    2021-02-05 21:20

    You need to use the clear-fix. Insert the following after your floated div, and within the containing div.

    And add the following style:

    .clear { clear:both; }
    

    Example:

    Hello World

提交回复
热议问题