How about this?
http://jsfiddle.net/NicoO/HfpL6/4/
.wrap
{
height:300px;
border:solid 1px blue;
}
.table {
width:100%;
height:100%;
display: table;
border-spacing: 2px;
}
.row
{
display: table-row;
}
.cell
{
display: table-cell;
border:solid 1px red;
vertical-align: middle;
}
#adjust{
height:50px;
}
This html:
<div class="wrap">
<div class="table">
<div class="row">
<div class="cell">
Auto Adjust
</div>
</div>
<div class="row">
<div id="adjust" class="cell">
Fixed Height
</div>
</div>
</div>
</div>
Update
The only other possibility i see is to use calc you sure need some more JS then: http://jsfiddle.net/NicoO/HfpL6/7/
You need to get all children with JS and apply a new height to all of them.
html, body
{
height: 100%;
margin:0;
padding:0;
}
*
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.wrap
{
height:300px;
border:solid 1px blue;
}
.table
{
width:100%;
height:100%;
}
.row
{
height: 50%;
position: relative;
}
.cell
{
border:solid 1px red;
vertical-align: middle;
position: absolute;
top:2px;
right:2px;
bottom:2px;
left:2px;
}
#adjust:not([style])
{
background-color: green;
}