CSS Utility Classes Text
Use common text utilities to control alignment, wrapping, weight, and more.
Text Alignment
Use text alignment utilities to easily align text in components.
_text-align:justify
or_text:justify
_text-align:left
or_text:left
_text-align:center
or_text:center
_text-align:right
or_text:right
Text Wrapping and Overflow
You can control text wrapping and overflow with the following utilities:
_white-space:normal
or_text:wrap
_white-space:nowrap
or_text:nowrap
_text:truncate
Text wrapping utilities also come with breakpoint-specific classes, same as text alignment classes.
Text Wrap
You can wrap text using the _white-space:normal
utility class.
Text Nowrap
You can prevent text from wrapping with a _white-space:nowrap
utility class.
Text Truncate
For longer content, adding the _text:truncate
utility class will truncate the text with an ellipsis. Truncation requires display: inline-block
or display: block
.
Word Break
Prevent long strings of text from breaking your layout by using _text:break-word
. Behind the scenes, it uses overflow-wrap: break-word
and word-break: break-word
for IE & Edge compatibility.
_text:break-word
Text Transform
You can transform text in components using text capitalization utility classes.
_text-transform:lowercase
or_text:lowercase
_text-transform:uppercase
or_text:uppercase
_text-transform:capitalize
or_text:capitalize
Font Weight
Font Weight utility classes enable you to emphasize or de-emphasize text by controlling its boldness. These utilities contribute to establishing a clear text hierarchy, improving the overall readability of your content.
_font-weight:extralight
or_text:extralight
_font-weight:light
or_text:light
_font-weight:normal
or_text:normal
_font-weight:semibold
or_text:semibold
_font-weight:bold
or_text:bold
_font-weight:black
or_text:black
_font-weight:lighter
or_text:lighter
_font-weight:bolder
or_text:bolder
Font Style
Italic utility classes allow you to style text with an italic font style. This can be particularly useful for emphasizing certain words or phrases, or for distinguishing between different types of content, such as quotes or citations.
_font-style:italic
or_text:italic
Font Size
Font size utilities provide a convenient way to increase or decrease the font size of your content.
_font-size:xs
or_text:xs
_font-size:sm
or_text:sm
_font-size:md
or_text:md
_font-size:lg
or_text:lg
_font-size:xl
or_text:xl
Monospace
Change your text to be monospaced using the _font-family:monospace
utility.
_font-family:monospace
or_text:monospace
Text Decoration
You can easily remove or add text decoration using the text decoration utility.
_text-decoration:none
_text-decoration:underline
_text-decoration:line-through
_text-decoration:overline
_text-decoration:inherit
Weak Text
Make your text stand out less using the weak or muted text color utility.
_text:weak
or_color:weak
_text:weaker
or_color:weaker
_text:weakest
or_color:weakest
_text:muted
or_color:muted
Text Reset
Make your text or link inherit the parent's color using the text reset utility.
_text:reset
Text Hide
You can make your text disappear without hiding the element by using the text-indent: -10000px
trick. This is available using the following utility class:
_text:hide
Lists
You can use list utilities to obtain inline and unstyled lists.
_list:inline
orlist -inline
_list:unstyled
orlist -unstyled