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

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

    Thank you LSerni you solved it for me.

    To achieve this :

    +-----------------------------------------+
    | +-------+                     +-------+ |
    | | Text1 |                     | Text1 | |
    | +-------+                     +-------+ |
    |+----------------------------------------+
    

    You have to do this :

    Text1
    Text2

提交回复
热议问题