Floating elements within a div, floats outside of div. Why?

前端 未结 10 1099
灰色年华
灰色年华 2020-11-22 05:10

Say you have a div, give it a definite width and put elements in it, in my case an img and another div.

The idea

10条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 05:51

    Put your floating div(s) in a div and in CSS give it overflow:hidden;
    it will work fine.

提交回复
热议问题