I'm using DIVs to build something similar to a table, and I need to stretch my DIVs to match the height of its neighbor, in order to get my background-color to display correctly.
Here is my example :
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Some title</title>
</head>
<body>
<div>
<div style="float:left; width: 49%; background-color: #ced6eb;">
Line1
<br/>
Line2
</div>
<div style="float:left; width: 49%; background-color: #dcddde; ">
Only one line here
</div>
<div style="clear: both;"></div>
</div>
<div>
<div style="float:left; width: 49%; background-color: #ced6eb;">
Something else
</div>
<div style="float:left; width: 49%; background-color: #dcddde;">
Something else
</div>
<div style="clear: both;"></div>
</div>
</body>
</html>
What I need is to have the gray background on all 3 lines on the right, instead of getting a blank line in the middle.
This is a simplified version of my HTML. The top left DIV (line1, line2) is of variable length, so a fixed attribute like height:30px
is not an acceptable solution.
Thanks !
Yves