<div id="wr">
<div id="con_top"></div>
<div id="con_bottom"></div>
</div>
#wr {
height:400px;
width:80%;
margin:50px auto;
border:1px solid black;
}
#con_top {
height:40px;
margin:5px;
border:1px solid red;
}
#con_bottom {
height:100%;
border:1px solid blue;
margin:5px;
}
How to make blue square, fit the black, parent container? Is it possible without javascript?
With table elements it’s much easier, but table is bugged in Opera and IE. td element on height 100% doesn’t work as intended, taking the height of table element itself ignoring the height of all others td in that table.
For example, open with Opera or IE:
Forget tables :). You could use absolute positioning:
jsFiddle Demo