I'm trying to design a layout with css, I got one main container(div) and two inner container(div_upper and div_lower). let say I want to resize div_upper and div_lower will automatically resize itself and both divs still fit in the main container. I'm sure this can be done in javascript, but is there any CSS to accomplish this? if so I would be glade.
+1
A:
Maybe this blogpost on the A List Apart website will help you in the right directions.
Zaagmans
2009-04-27 08:09:16
A:
You could just not specify a height on the inner divs and set it to
div {
overflow: visible
}
They should resize. On the other hand, if you have the inner divs floated to left and right and they have a background image, you can use faux columns for that, as detailed in this post by A List Apart.
Brandon Wang
2009-06-15 23:08:20
A:
Anoother solution:
Use this class for getting auto vertical height -
.getAutoHeight {
position: relative;
overflow: auto;
}
<div class="getAutoHeight ">
any content<br />
any content<br />
any content<br />
any content<br />
</div>
Otabek
2010-10-21 15:22:05