I've been scratching my head while thinking about this issue. I have 3 divs. The top and bottom div have a min-height, the middle div has unknown height (expands by content) but should be centered in the page. The top and bottom div should then fill up the remaining top and bottom space.
http://oi43.tinypic.com/5lb3v5.jpg
I'd like to have a pure HTML/CSS solution. Refactoring the HTML structure is possible..
Thanks
Current HTML structure:
<div id="page">
<div id="top">top div</div
<div id="middle">middle div</div>
<div id="bottom">bottom div</div>
</div>
And CSS:
#page {
min-height: 100%;
height: 100%;
width: 100%;
}
#top, #bottom {
min-height: 17.5%;
height: auto !important; /* Set height to content height but keep it minimum 17.5% */
height: 17.5%; /* Some IE don't understand min-height... */
width: 100%;
}
#middle {
height: auto;
width: 100%;
}