This might be a silly question but I'm certain I'm not the only one wondering.
I'm aware of the alignment classes: <p class="text-center">Text Centered within the block element</p>
<p class="text-right">Text aligned to the right within the block element</p>
<p class="text-left">Text aligned to the left within the block element</p>
Is there a set of classes in Twitters Bootstrap Framework that justifies text?
e.g. <p class="text-justify">Sample Text Goes Here</p>
why does it appear that bootstrap do not incorporate a utility function such as text-align: justify
?
The text can justified by using the . text-justify class and for left, right, and center alignment of text, use the text-left, text-right and text-center classes respectively.
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.
In Bootstrap 3 and Bootstrap 4 you can use the following:
<p class="text-justify">Justified text.</p>
Official documentation
(Update) This feature removed from Bootstrap 5
Note that we don't provide utility classes for justified text. While, aesthetically, justified text might look more appealing, it does make word-spacing more random and therefore harder to read.
Based on the official UX suggestion: don't use justified text! ;)
No. But you can add a new class on bootstrap.css
.text-justify { text-align: justify; }
Update
Previous versions of bootstrap was not supporting text-justify
. But bootstrap 3 has added a class text-justify
.
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