This is my code for a nice looking form:
<dl>
<dt class='breed'><label for="nwberichten">Fieldname</label></dt>
<dd>
Input
</dd>
<div class='clear'> </div>
</dl>
<dl class='oe'>
<dt class='breed'><label for="nwberichten">Fieldname</label></dt>
<dd>
Input
</dd>
<div class='clear'> </div>
</dl>
With the folowing CSS
dl {margin-top:0px;}
dt {float:left; text-align:right; width:120px; line-height:25px; margin:0 10px 10px 0;}
dd {float:left; width:400px; line-height:25px; margin:0 0 10px 0;}
DL {
border-bottom:1px dashed #aaa;
margin:0px;
line-height:20px;
padding-top:6px;;
}
DL DD {
line-height:20px;
background:transparent;
}
DT {
line-height:20px;
background:transparent;
}
DL.oe {
background:#efe;
}
In webkit (eg Safari) the Uneven row, the one with the BG color #efe looks perfect. The bgcolor goes from one dashed border to the other.
In IE the color is only 10px (or so) high and the looks are messed up.
How is this possible?
I’ll briefly explain what I did and why. The code is at the end.
The first mistake is using clearing
divs inside thedlelement. Adlcan only containdds anddts. To achieve clearing you can setoverflowtohiddenfor yourdls. It achieves the same effect. This is also probably why your page looks a bit messed up in IE (because of thedivs in thedls)As for the rest, I just cleaned up your CSS a bit.
HTML:
CSS: