Vertically split variable-sized div using CSS
Posted
by Martijn
on Stack Overflow
See other posts from Stack Overflow
or by Martijn
Published on 2010-03-23T15:20:37Z
Indexed on
2010/03/23
15:23 UTC
Read the original article
Hit count: 670
I'm trying to divide an auto-scaling div
into two vertically using two other div
's. What I have so far:
<div id='wrapper'>
<div id='left'>some stuff</div>
<div id='right'>more stuff</div>
</div>
with
#frame {
position: static;
width: 1000px;
height: auto;
/* more positioning stuff */
}
#left {
position: absolute;
width: 200px;
height: 100%;
}
#right {
position: static;
margin-left: 200px;
}
This seems to work OK, except if the contents of #right
are higher than those of #left
. In this case, part of the contents of left are invisible. How can I make sure that the height of the left div is also taken into account when the needed height of #wrapper
is calculated?
© Stack Overflow or respective owner