I'm uncertain about the clarity of the properties of this DIV
. Please note that this is not a complete answer, as it's too lengthy for a comment.
<div id="container">
<div id="list">
<ul></ul>
</div>
<div id="content">
<span>TEST CONTENT</span>
</div>
</div>
#container {
height: 100px;
background: grey;
}
#list {
max-height: 70px;
overflow: auto;
background: #ddf;
}
#content {
min-height: 30px;
height: auto;
background: #fdf;
}
// For testing
setInterval(function(){
$('ul').append('<li>Test</li>');
},3000);
http://jsfiddle.net/V8yuN/
If you aim for the initial full height of DIV#content
to shrink as the DIV#list UL
expands, what purpose does DIV#content
serve in your design? It's worth mentioning that I placed the UL
inside a DIV
.
The linked fiddle demonstrates a scenario resembling your description (pushing DIV#content
to the bottom). The question remains - how crucial is the height
attribute of DIV#content
to your layout?
EDIT
In case you set #container
to overflow: hidden
and define #content
's height: 100%
, it might give an impression of the #container
shrinking.
#container {
height: 100px;
background: grey;
overflow: hidden;
}
#list {
max-height: 70px;
overflow: auto;
background: #ddf;
}
#content {
height: 100%;
background: #fdf;
}
http://jsfiddle.net/V8yuN/2
However, the above adjustment may affect your design negatively if the content within #content
needs to be displayed dynamically.
EDIT 2
The code below accomplishes all elements except the vertical-align
property for the text inside #content
:
HTML
<div id="container">
<div id="push">
<div id="list">
<ul></ul>
</div>
<div id="content">
<div class="border-top"></div>
<div id="content-inner">
<span>TEST CONTENT</span>
</div>
</div>
</div>
<div class="border-bottom"></div>
</div>
CSS
#container {
height: 100px;
background: grey;
}
#push {
height: 95px;
overflow: hidden;
}
#list {
max-height: 70px;
overflow: auto;
background: #ddf;
}
#content-inner {
min-height: 100px;
background: #dfd;
margin: 0;
border-left: 5px solid #fdf;
border-right: 5px solid #fdf;
}
.border-top {
background: #fdf;
border-radius: 5px 5px 0 0;
height: 5px;
}
.border-bottom {
background: #fdf;
border-radius: 0 0 5px 5px;
height: 5px;
}
http://jsfiddle.net/V8yuN/6/