The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Aligning Text
I want to align text in a group of like so:
Subtotal: $500 Total: $500
Here is the HTML I currently have:
<p>Subtotal:<span>$500</span></p>
<p>Total:<span>$500</span></p>
Is this even possible or should I look for an alternate way to lay it out?
Thanks.
Here is what I ended up doing:
<style> p { width: 300px' display: block; clear: both; } span { display: inline-block; } .label { font-weight: bold; width: 65%; } .value { width: 35%; } </style> <p><span class="label">Subtotal:</span><span class="value">$500</span></p>
This is why the table element exists.
Yep @Senff .
A lot of people shy away from using the table at all but in a case like this one… you are spending more time and resources to format it without using tables than not.
In the code you have above, you basically created a table.
Compare: http://cdpn.io/cnBvj