View Full Version : Right-aligned form fields

10-07-2007, 06:36 PM
I'd like to have several form fields and text describing them right-aligned. Meaning that all the text boxes would be right-aligned, in one neat row. Then there'd be labels for each text box to the left of the text box, but right-aligned against the text box. (If I haven't described it clearly I can describe it better.)

The only way I've been able to do this is by having <input><span>, then floating both to the right. Because input appears in the markup first, it'll get floated to the right first, giving the desired effect. My question is whether it's possible to create this design by placing the span before the input in the markup.

After all, it doesn't seem intuitive that input appears before span in the markup but span appears before input in the rendered page. How can I achieve the desired effect with the markup representing the structure rather than the design of the page (i.e. span before input in markup)?


10-07-2007, 07:05 PM
If you post your curent code, the picture would be more clear!