Text Utilities
Text Alignment
Easily realign text to components with text alignment classes.
Column sizes and their responsive variants:
.text-justify
.text-left
.text-center
.text-right
.text-sm-left
.text-sm-center
.text-sm-right
.text-md-left
.text-md-center
.text-md-right
.text-lg-left
.text-lg-center
.text-lg-right
.text-xl-left
.text-xl-center
.text-xl-right
Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. Praeterea iter est quasdam res quas ex communi. At nos hinc posthac, sitientis piros Afros. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Cras mattis iudicium purus sit amet fermentum.
Left aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
Right aligned text on all viewport sizes.
Left aligned text on viewports sized SM (small) or wider.
Left aligned text on viewports sized MD (medium) or wider.
Left aligned text on viewports sized LG (large) or wider.
Left aligned text on viewports sized XL (extra-large) or wider.
<p class="text-justify">Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. Praeterea iter est quasdam res quas ex communi. At nos hinc posthac, sitientis piros Afros. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Cras mattis iudicium purus sit amet fermentum.</p>
<p class="text-left">Left aligned text on all viewport sizes.</p>
<p class="text-center">Center aligned text on all viewport sizes.</p>
<p class="text-right">Right aligned text on all viewport sizes.</p>
<p class="text-sm-right">Left aligned text on viewports sized SM (small) or wider.</p>
<p class="text-md-right">Left aligned text on viewports sized MD (medium) or wider.</p>
<p class="text-lg-right">Left aligned text on viewports sized LG (large) or wider.</p>
<p class="text-xl-right">Left aligned text on viewports sized XL (extra-large) or wider.</p>
Text Wrapping and Overflow
Wrap text with a .text-wrap
class.
Prevent text from wrapping with a .text-nowrap
class.
For longer content, you can add a .text-truncate
class to truncate the text with an ellipsis. Requires display: inline-block
or display: block
.
Prevent long strings of text from breaking your components’ layout by using .text-break
to set overflow-wrap: break-word
(and word-break: break-word
for IE & Edge compatibility).
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Text Transform
Transform text in components with text capitalization classes.
.text-lowercase
- Lowercased text.
.text-uppercase
- Uppercased text.
.text-capitalize
- capitalized text.
<span class="text-lowercase">Lowercased text.</span>
<span class="text-uppercase">Uppercased text.</span>
<span class="text-capitalize">capitalized text.</span>
Font weight and italics
Quickly change the weight (boldness) of text or italicize text.
.font-weight-bold
- Bold text.
.font-weight-bolder
- Bolder weight text (relative to the parent element).
.font-weight-normal
- Normal weight text.
.font-weight-light
- Light weight text.
.font-weight-lighter
- Lighter weight text (relative to the parent element).
.font-italic
- Italic text.
<span class="font-weight-bold">Bold text.</span>
<span class="font-weight-bolder">Bolder text.</span>
<span class="font-weight-normal">Normal weight text.</span>
<span class="font-weight-light">Light weight text.</span>
<span class="font-weight-lighter">Lighter weight text.</span>
<span class="font-italic">Italic text.</span>
Monospace
Change a selection to our monospace font stack with .text-monospace
.
This is in monospace
<span> class="text-monospace">This is in monospace</span>
Reset color
Reset a text or link’s color with .text-reset
, so that it inherits the color from its parent.
Muted text without a reset link.
Muted text with a reset link.
<p class="text-muted">
Muted text with a <a href="#" class="text-reset">reset link</a>.
</p>
Text decoration
Remove a text decoration with a .text-decoration-none
class.
<a href="#" class="text-decoration-none">Non-underlined link</a>
Bootstrap basic colors
.text-white
and .text-muted
class has no additional link styling beyond underline.
.text-primary
.text-secondary
.text-success
.text-danger
.text-warning
.text-info
.text-light
.text-dark
.text-body
.text-muted
.text-white
.text-black-50
.text-white-50
Text color
Available are color classes for text containing all colors from Material Design color pallette
.transparent-text
class.
<div class="red-text">
<!-- All text here will be red -->
</div>
Font alpha
Since font colors are defined in RGB colors you are able to change also color alpha opacity with text-alpha-*
classes. For class to take the effect it must be combined with text color class e.g. red-text text-alpha-4
.
XS Font size
Sometimes is necessary to adjust font size for smaller screens. These classes do the job.
.text-xsmall
- x small text on all screens
.text-small
- small text on all screens
.text-xsmall .text-sm-normal
- x small text on xs screens
.text-small .text-sm-normal
- small text on xs screens
.text-md-xsmall .text-lg-normal
- x small text on lg screens
.text-md-small .text-lg-normal
- small text on lg screens