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

前端 未结 10 1162
灰色年华
灰色年华 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:33

    You can easily do with first you can make the div flex and apply justify content right or left and your problem is solved.

提交回复
热议问题