How to display data based on DIV?

Display data http://i39.tinypic.com/30xifj9.jpg

I want to display this datatype with Divs and other elements like ul li p span, maybe minimal labels.

Note: . Are re-blocked and the left content is right aligned and the content on the right is left aligned.

Please provide a good solution for this with minimal code.

Here is a link of what I tried to do with UL-LI

wazdeisgn

0


source to share


2 answers


<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, as the default and margins don't affect your box model.

+4


source


First put the labels in a div or span container and the values ​​in their own container. Give the labels a class like "label".

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



Put the container of values ​​to the left if you think the values ​​will wrap to the next line; this will stop them from wrapping in the same vertical space as the label. If you do, make sure each shortcut also has a clear one: on the left is applied so that it runs on its own line.

0


source







All Articles