user2243357 user2243357 - 1 month ago 21
CSS Question

Justify Paragraph Text HTML

How would one justify this text??
I have tried and searched for days to get something so simple to work..

Ex:

HTML:

<div id="justify">
<p>I just want this to justify..</p>
</div>


CSS:

#justify {
width: 100%;
background: #D33;
}

#justify p {
margin: 0 auto;
max-width: 70%;
list-style: disc outside none;
text-align: justify;
display: list-item;
background: #ccc;
}


Here on JSFiddle:

http://jsfiddle.net/xDqwF/

Any help would be much appreciated.

Answer
#justify p:after {
  content: "";
  display: inline-block;
  width: 100%;
}

Through some HTML Trickery, this should work. I found it on a blog post ages ago when I had a similar problem. Check it out on the JSFiddle

http://jsfiddle.net/xDqwF/2/