<html style="margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;">
<body style="height:100%;width:100%;">
<div style="height:20px;background-color:red;"></div>
<div style="background-color:black;"></div>
<div style="height:20px;background-color:blue;"></div>
</body>
</html>
How can I make the second div stretch to fill remaining space (after placing the first and third div) in the body?
If you want the stick footer system, then use this technique:
http://ryanfait.com/resources/footer-stick-to-bottom-of-page/
If I understand your intent properly (who knows..):
Live Demo (edit)
HTML:
CSS:
Use all % or all pixels(find screen pixel height in js)
Other perfect answer derived from above answer