Float Creates Overlapping Divs

前端 未结 5 555
小鲜肉
小鲜肉 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:03

    Maybe handy to note that there is also the well know clearfix code from positioniseverything that is written specifically for this problem and is probably most robust and easiest to apply in any situation. The CSS looks as follows:

    
    

    In order to use it in your situation you would do the following:

    
    
    Inner Div:
    Testing long content.

提交回复
热议问题