tags:

views:

605

answers:

2
+4  A: 
<dl>
<dt>user</dt><dd>3234234234234</dd>
<dt>something</dt><dd>3234234234234</dd>
<dt>wharever</dt><dd>3234234234234</dd>
</dl>

dl { float: left; width: 300px; height: auto; margin-bottom: 5px; }
dt { float: left; width: 100px; height: auto; text-align:right; }
dd { float: right; width: 200px; height: auto; text-align:left; }

of course you should have a good "css reset" before, for the default paddings and margins not affect your box model.

zalew
meh... better answer than mine. +1
Nathan Ridley
A: 

First, place the labels in a div or span container, and the values in their own container. Give the labels a class such as "label".

Next, in your css, float the labels left and give them a fixed width. Set the text-align attribute of the label class to "right".

Float the value container left also if you think the values will wrap to the next line; this will stop them from wrapping into the same vertical space as the label. If you do this though, make sure each label also has clear:left applied so that it starts on its own line.

Nathan Ridley