I am trying to make a scrollable div box, and it's height should be exact fit to screen's height(100%).
The problem is if there is a another div box on the top which is the fixed height, how do I make scrollable box to fit to the screen's height?
This is what I tried
<div class="wrap">
<div class="top">
Fixed height 100px. No floating or layered box
</div>
<div class="scrollBox">
Fluid height to screen height 100%
<br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br><br>test<br>
</div>
</div>
html, body { height:100%; margin:0; padding:0; }
.wrap { height:100%; background:lightblue }
.top { height:100px; background:green}
.scrollBox { width:80%; height:100%; margin:0 auto 0 auto; border:1px solid #000; overflow-y:auto; background:#eee; }
This is my demo here http://jsfiddle.net/a5ktensk/77/
Please help