I need my last div ("content"), whose height can vary, to expand to fill the container div but not expand beyond it. If the content div's contents won't fit, it should simply scroll with overflow-y: auto
However, I can't seem to contain the content div. I've tried a host of css without success and would appreciate some help.
UPDATE
I see I left out one important piece of info. I do not want to specify a fixed height of the "content" div since the height of the container can vary (it is resizable). I would have to calculate and adjust the height of the content with each mousemove
(which I am trying to avoid).
Here is a fiddle
#container {
max-height: 350px;
width: 200px;
border: 2px solid black;
display: block;
position: absolute;
}
#title {
height: 100px;
width: 100%;
border: 2px solid red;
}
#tabs {
height: 100px;
width: 100%;
border: 2px solid green;
}
#content {
height: 100%;
width: 100%;
border: 2px solid blue;
overflow-y: auto;
}
<div id="container">
<div id="title">
Title
</div>
<div id="tabs">
Tabs
</div>
<div id="content">
<table>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
<tr>
<td>
<label>ABC</label>
</td>
</tr>
</table>
</div>
</div>