Toby van Kempen Toby van Kempen - 7 months ago 21
HTML Question

How can I justify text in HTML/CSS?

I made a little text in HTML and it's looking fine, but I want it to be neatly stacked, or neatly aligned. Link one shows what I have right now, and link two shows what I want. Please ignore the red "Verdana".

This is what I have now, and what I don't want:
http://postimg.org/image/hho1sip5b/c9d22691/

This is what I don't have yet, but what I want:
http://postimg.org/image/7j5y11wjn/3d5e5ca5/

My code is as follows:

<div class="left">
<p style="text-align: justify; height: 7px;">&nbsp;</p>

<p style="line-height: 22px; font-size: 10px; font-family: Verdana; ">
<span style="letter-spacing: 1px">Big-ass piece of not-so-interesting text</span>
</p>

<p style="line-height: 28px; font-size: 18px; font-family: GillSans-Light; ">
REDRUM
<br>NIEUWE KAZERNELAAN 2-3
<br>6711 JC EDE
<br>POSTBUS 8193
<br>6710 AD EDE
</p>
</div>


All help greatly appreciated! Thanks in advance!

Answer

You have text-align: justify on an element with no text... try applying it to your actual text and it should work!