Is there a way to design a layout with a fixed height div at the top and a second div below that always fills up the rest of the page's height and width, adjusting accordingly when the window is resized? An example of what I'm aiming for can be seen on
I've tried the following code:
<html>
<head>
<body style="width:100%;height:100%;position:absolute;background:#EEE;margin:0 auto">
<div style="border-bottom:1px solid #000;height:50px;background:#900">1st div</div>
<div style="height:100%;width:100%;background:#090">2nd div</div>
</body>
</html>
This sets up a fixed div at the top and a resizable div below it. However, the second div doesn't adjust its height according to the first div, making it taller than desired. Adjusting the height % manually solves this issue, but it's not consistent during window resizing due to the fixed height above.
Is there a solution without using JavaScript?