Float Creates Overlapping Divs

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

    If you don't want to add additional markup to your html or add a width to your outer div, you can use:

    #div1 {
        overflow:hidden;   /* clears float for most browsers */
        zoom:1;            /* clears float for IE6           */
        }
    

提交回复
热议问题