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

后端 未结 22 2825
自闭症患者
自闭症患者 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条回答
  •  青春惊慌失措
    2020-11-21 07:57

    You could use Faux Columns.

    Basically it uses a background image in a containing DIV to simulate the two equal-height-DIVs. Using this technique also allowes you to add shadows, rounded corners, custom borders or other funky patterns to your containers.

    Only works with fixed-width boxes though.

    Well tested out and properly working in every browser.

提交回复
热议问题