I'm writing a webpage on which I need to have a div wrapper containing two divs (one toolbar and one editor). The toolbar heigth is not known, and I need to make the editor div fill all the remaining space within the wrapper.
The solution need to be full HTML + CSS.
<div id="wrapper">
<div id="toolbar">
</div>
<div id="editor">
</div>
</div>
For the CSS:
#wrapper {
position: absolute; // I need this, I can't remove it
top: 0; // should stick on the top
height: 100%; // should span across the whole height
width: 100%; // Can be anything 0 ≤ width ≤ 100%
}
#editor {
width: 100%; // fill the whole horizontal space
height: 100%; // if I do so, the div gets too high and the #editor goes beyond the wrapper limit
}
Here's a jsfidlle to play with http://jsfiddle.net/o3hqyxxu/