I have a 3 container structure. container 1 is of x height...container 2 fills the rest of the window...container 3 SHOULD start after container 2, but its disappeared.
JSFIDDLE
HTML
<header>
</header>
<div id="maincontent">
</div>
<footer>
</footer>
css:
html,body{padding:0; margin:0;}
header{
background-color:red;
height:1.8em;
}
#maincontent{
background-color:black;
position:absolute;
top:1.8em;
bottom:0;
width:100%;
}
footer{
background-color:yellow;
height:50px;
}
How can i get container 3 (footer to follow container 2). I know its position absolute of container 2 thats causing the problem but thats the only way I can get that container to fill the screen.
I've tryed playing around with margins to no avail;
Clearer explanation of what i'm trying to achieve:
container1 + container 2 = 100% height. Then scroll to see containe 3.
I could acheive this in javascript but was hoping it was possible in css.