I'm trying to justify the text within this p tag so that it perfectly fits the width of the p.
<p align="justify" style="text-align: justify !important; color:#fff; margin:0px; font-weight:bold; width:487px; border:Solid 1px red;">blah blah blah</p>
but the text just wont justify! any idea why?
thanks for any help.
This is because text-align:center only affects inline elements, and <aside> is not an inline element by default. It is a block-level element. To align it, we will have to use something other than text-align , or turn it into an inline element.
In order to suggest that some text be justified on both sides, you can use the align="justify" attribute in HTML, or the text-align:justify declaration in CSS, or both.
Justifying text disrupts that even texture. Even if a page layout program is using subtle letter-spacing, or adjusting the width of the letters – these things, too, will make the texture uneven. So, justified text should really be avoided not just on the web, but whenever possible.
You can use the solution described here: http://blog.vjeux.com/2011/css/css-one-line-justify.html
This will justify a single line but adds a space after, so if you know the height, you can specify it with overflow:hidden
to conceal it and still get the justification.
.fulljustify { text-align:justify; } .fulljustify:after { content: ""; display: inline-block; width: 100%; } #tagline { height: 80px; overflow: hidden; line-height: 80px; /* vert-center */ }
<p id="tagline" class="fulljustify">Blah blah blah</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With