Hi Guys. Need a little help with variable height divs laid out as columns.
The basic code I have is below, Im used to table layouts but slowly trying to get to grips with DIVs, with a table layout this would be simple.
I have a container div, with two column divs inside. They are variable height depending on the content. The result im after is for both columns to be the same height depending on which one has more content, ie is the left column has more content than the right the right will match the left columns height and vice-versa.
Is this even possible using divs & css? Just to clarify both columns should be the same height as each other (depending on which has more content), I dont want them to be bigger than required and as the content comes from a database I don’t want to fix the heights.
Thanks in advance
James
<div class="columns">
<div class="column left">VARIABLE HEIGHT CONTENT<br>row2</div>
<div class="column right">VARIABLE HEIGHT CONTENT<br>row2<br>row3</div>
<div style="clear:both;"></div>
</div>
.columns{
width:100%;
height:100%;
clear:both;
border: 1px #000000 solid;
clear: both;
}
.column.left{
float:left;
clear:none;
width:49.5%;
height:100%;
border: 1px red solid;
background-color: green;
}
.column.right{
float:right;
clear:none;
width:49.5%;
height:100%;
border: 1px blue solid;
background-color: yellow;
}