I'm not sure if I should be using tables here to structure the layout or
if CSS is okay. I have a data entry form in which I have floated the
labels to one side, and given them a specific width. With regular input
such as textboxes, everything lines up fine. The problem I'm having is
that I have an unordered list of checkboxes, and only the first item
will line up with the label. The additional checkboxes and their labels
end up being rendered directly below the label. How can I keep the list
lined up straight, and flush with the right edge of the label like the
other fields are?
I should also note that I tried wrapping the list in a div and setting
the margin-left property to the same offset as the label width, but it
did not line up, instead it started a good bit farther to the right of
the label's right edge.
<div class="field-set">
<label class="field-label">Contact Roles:</label>
<ul style="list-style:none; margin-top:0; margin-left:0; padding-left:0;">
<li style="margin-left:0;"><input type="checkbox" id="AccountAdmi n"/>
<label for="AccountAdm in">Account Admin</label></li>
<li style="margin-left:0;"><input type="checkbox" id="Technical"/>
<label for="Technical" >Technical</label></li>
<li style="margin-left:0;"><input type="checkbox" id="Sales"/> <label
for="Sales">Sal es</label></li>
</ul>
</div>
div.field-set {
margin-bottom:3px;
}
label.field-label {
float:left;
width:17em;
margin-right:.5em;
font-weight:bold;
font-size:.85em;
margin-top:.15em;
background-color:#F8F8F8;
padding-top:4px;
/*padding:4px 0px 4px 4px;*/
}
Thanks,
Steve
if CSS is okay. I have a data entry form in which I have floated the
labels to one side, and given them a specific width. With regular input
such as textboxes, everything lines up fine. The problem I'm having is
that I have an unordered list of checkboxes, and only the first item
will line up with the label. The additional checkboxes and their labels
end up being rendered directly below the label. How can I keep the list
lined up straight, and flush with the right edge of the label like the
other fields are?
I should also note that I tried wrapping the list in a div and setting
the margin-left property to the same offset as the label width, but it
did not line up, instead it started a good bit farther to the right of
the label's right edge.
<div class="field-set">
<label class="field-label">Contact Roles:</label>
<ul style="list-style:none; margin-top:0; margin-left:0; padding-left:0;">
<li style="margin-left:0;"><input type="checkbox" id="AccountAdmi n"/>
<label for="AccountAdm in">Account Admin</label></li>
<li style="margin-left:0;"><input type="checkbox" id="Technical"/>
<label for="Technical" >Technical</label></li>
<li style="margin-left:0;"><input type="checkbox" id="Sales"/> <label
for="Sales">Sal es</label></li>
</ul>
</div>
div.field-set {
margin-bottom:3px;
}
label.field-label {
float:left;
width:17em;
margin-right:.5em;
font-weight:bold;
font-size:.85em;
margin-top:.15em;
background-color:#F8F8F8;
padding-top:4px;
/*padding:4px 0px 4px 4px;*/
}
Thanks,
Steve
Comment