How to make child div same height as parent?
I have a set of divs like
<div id="div2"></div> <div id="div3"></div>
The content of 2 and 3 can make it so their heights are different, but I want to make it so they are always the same. So if div3 is taller than div2, div2 should stretch to be as tall as div3.
I thought setting their heights to 100% would do the trick, since if div3 gets taller, then div1 must get taller making it so div2 is no longer at 100% height and would need to stretch back to 100%. But this doesn't work. How can I do this?
100% (or any percetage) height can only refer to the set height of the parent - if the parent's height is not explicitly set, then the percentage heights will default to "auto". Depending on the situation, the faux column technique can make it look like the columns are equal when in fact they aren't.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)