Im here because other similar questions couldn\'t help my particular problem.
I need right div
to be 100% height all the time, where the parent
Give position:fixed
and height:100%
for the right div. This will solve your issue.
Try by giving the height of container a fixed value
this will also fix the issue. Just tried it in jsFiddle
http://jsfiddle.net/C9Kmx/35/
.container
{
min-height: 10px;
width: auto;
height: 100px;
background-color: #eeeeee;
}
By reading your comments on other solutions it is clear to me that only solution for you is to implement some JS into your code. This is not a problem, however.
http://jsfiddle.net/b7TuP/
Make the right div position:absolute;
and make the parent div position:relative;
and then height:100%;
will work for the right div. Make sure you also adjust its x-position and width accordingly. In this example I gave it a left:50px
to make sure it appears to the right of the left column.
JSFiddle http://jsfiddle.net/e9mvD/
.parent{
position: relative;
width: 100px;
height: auto;
}
.child{
width: 50px;
height: 100px;
background-color: red;
}
.child_absolute{
position: absolute;
left: 50px;
top: 0;
bottom: 0;
width: 50px;
background-color: blue;
}
<div class="parent">
<div class="child"></div>
<div class="child_absolute"></div>
</div>
You can use the table-cell
value of the display
property in this layout and remove the float
like this:
.left, .right{
display:table-cell;
}
live demo http://jsfiddle.net/C9Kmx/34/