![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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="AccountAdmin"/ label for="AccountAdmin">Account Admin</label></li |
#3
| |||
| |||
|
|
div class="field-set" label class="field-label">Contact Roles:</label This isn't an appropriate use of the LABEL tag. "The LABEL element is used to specify labels for controls that do not have implicit labels." Instead of the DIV, why not use the FIELDSET tag which exists for this purpose? Then, instead of LABEL, use the LEGEND tag. |
|
You start your LABEL tags on new lines. A new line character is treated as white space. Any white space is a legitimate place for the browser to insert a line break. If you don't want a line break, have ... id="AccountAdmin"/> <label ... all on one line. (Instead of the , you could put half an em of left padding on the label.) |
#4
| |||
| |||
|
|
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. I'm not sure what you mean by this. How about a url? div class="field-set" why not <fieldset>? |
#5
| |||
| |||
|
|
The problem is that I *do* want line breaks in the list. The display should look something like this: Contact Roles: O Account Admin O Technical O Sales Instead I am getting this: Contact Roles: O Account Admin O Technical O Sales |
|
Hopefully this explains what I'm looking to do a bit more clearly. |
#6
| |||
| |||
|
|
The problem is that I *do* want line breaks in the list. The display should look something like this: Contact Roles: O Account Admin O Technical O Sales Instead I am getting this: Contact Roles: O Account Admin O Technical O Sales This is too esoteric for me. As far as I can tell they are identical. :-) |
#7
| |||
| |||
|
|
I apologize for that, my news client stripped out the tabs on each line when I posted. When I get home tonight I'll try to put up a page demonstrating what I'm trying to achieve, and what I'm getting. |
#8
| |||
| |||
|
|
I have put up a page demonstrating what I want, and what I am encountering. http://www.digitalnothing.com/alignmentProblem.html Hopefully that page will finally make my problem clear. The problem occurs in both Firefox and IE. |
![]() |
| Thread Tools | |
| Display Modes | |
| |