Making a div float left, but not “fall” if text is too long

前端 未结 3 2126
一个人的身影
一个人的身影 2021-02-07 11:04

I\'m sorry for the horrible title.

Essentially, I have a containing div which contains two divs with position: relative; and

3条回答
  •  你的背包
    2021-02-07 11:36

    I'm not sure if you need the second div to be floated but here's an example that seems to do what you want with the second div having the float removed but having a 200px margin added to it.

    http://jsfiddle.net/chrisvenus/ZdFwD/1/

    I also swapped the images for fixed width DIVs since on my browser the broken image was just being removed.

    If the content in the right becomes too big and unbreakable then the overflow will ensure scrollbars are created for that div instead of it increasing the div size and then dropping it down or other undesired behaviour.

    this might not be perfect for your needs but if not it should be a good start. :)

提交回复
热议问题