How do I keep two side-by-side divs the same height?

后端 未结 22 2801
自闭症患者
自闭症患者 2020-11-21 07:56

I have two divs side by side. I\'d like the height of them to be the same, and stay the same if one of them resizes. I can\'t figure this one out though. Ideas?

To c

22条回答
  •  -上瘾入骨i
    2020-11-21 08:23

    This is an area where CSS has never really had any solutions — you’re down to using

    tags (or faking them using the CSS display:table* values), as that’s the only place where a “keep a bunch of elements the same height” was implemented.

    Some content!
    Some content!
    Some content!
    Some content!
    Some content!
    Some content!

    This works in all versions of Firefox, Chrome and Safari, Opera from at least version 8, and in IE from version 8.

    提交回复
    热议问题