Hi, I'm trying to get a div to extend to 100% height with the bottom of the scroll bar still visible, when also contained with a fixed height div. Can someone please help me out :)
When using the bellow layout, the vertical scroll bar at the bottom of .div2 falls off the height of the viewpoint, i'm guessing because .div1 is 200px high, pushing div1 to be 100% height + 200px.
Is there a way i can have .div1 be fixed height, and .div2 extend to fill the remaining window height and overflow when that height is reached.
Here is the CSS
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
overflow:hidden;
}
.container
{
height:100%;
}
.leftContent {
left:0;
top:0;
padding:0;
width:250px;
height:100%;
color:white;
background:blue;
overflow:hidden;
border:blue solid;
}
.div1
{
height:200px;
background-color:black;
border: red solid;
}
.div2
{
overflow:scroll;
height:100%;
border:yellow solid;
}
And here is the HTML.
<div id="container" class="container">
<!-- Start Left Column-->
<div id="leftColumn" class="leftContent">
<div id="div1" class="div1">
CONTENT
</div>
<div id="div2" class="div2">
START START START START START START START START START START START START START START START START
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
END END END END END END END END END END END END END END END END END END END END END END END END
</div>
</div>
<!-- End Left Column-->
</div>
Much appreciated. Thanks