JSFiddle - React, Tailwind, and code Playground
http://stackoverflow.com/questions/16615134/div-as-height-as-possible-100-stretch
by lalatino
HTML
<div id="top"> top </div>
<div id="main"> main </div>
CSS
#top {
position:fixed;
top:0px;
height:100px;
width:100%;
background-color:#fcc;
}
#main {
position:absolute;
background-color:#ccf;
overflow-y:scroll;
top:100px;
bottom:0;
left:0;
right:0;
}
html, body {
margin:0;
padding:0;
height:100%;
background-color:blue;
}
JavaScript
var i, s='';
for (i=1; i<100; i++) { s+= i+'.<br/>'; }
document.getElementById('main').innerHTML += s;