Set div height to fit to the browser bottom

by Avinashullal

HTML

<div style="background: red; width: 100%; height: 200px">

</div>
<div id="first">Hello, I'm first!</div>

CSS

#first {
    width: 200px;
    height: 100px;
    background-color: #BADA55;

}

JavaScript

$('#first').height(function(index, height) {
    return window.innerHeight - $(this).offset().top;
});