I have a <div> which I want to display full screen, but I also need to incorporate a 60px high <div> and a 10px high <div> at the top of the document. The size of the main div will need to re-size as the browser window is re-sized to keep it full screen.
<div id="div1" style="height: 60px">
</div>
<div id="div2" style="height: 10px">
</div>
<div id="fullscreen">
</div>
So:
fullscreen height = document size - (#div1 + #div2)
On re-size recalculate the above value.
One way to achieve this in some cases via just HTML and CSS is to have absolutely positioned div with it’s top set to the
70pxand every other direction set to0px. Then every other side will adjust itself to the edges of the browser window.For example: