Last div full available viewport height

by André Masson

HTML

<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<div id="a">1</div>
<div id="b">2</div>
<div id="c">3</div>
<div id="d">4</div>
<div id="container">Stuff that should go to the bottom of the window</div>

CSS

#a {background:red;}
#b {background:green;}
#c {background:blue;}
#d {background:orange;}
#container { background:yellow; }

div {height:20px; width:100%;}

JavaScript

$('#container').height($(window).height() - $('#a').height() - $('#b').height() - $('#c').height() - $('#d').height());