I've been struggling to create an input form with labeled using a dl, dt, dd list. I want the first label on the left, the second on the right, and the input in the center. However, no matter what I try, I can't get the second label to align correctly next to the input...
Here is an example of what I'm aiming for:
Here's my current attempt:
dt {
clear: both;
width: 25%;
float: right;
text-align: left;
}
label {
font: 11px Tahoma, sans-serif;
color: #000;
}
dd {
float: right;
width: 25%;
margin: 0 0 15px;
}
<dl class="inline">
<dt><label for="name">label1</label></dt>
<dd>
<input type="text" id="name" class="text" />
<small>input description</small>
</dd>
<dt><label for="name">label2</label></dt>
</dl>
Note: I really prefer to stick with using dl, dt, dd elements.