CSS Text
Use these classes to modify text utilities alignment, weight, style, and more.
Text styling
You can use .text-type-1
through .text-type-7
classes when you need to match styling but can't use its HTML element. Use text-type-{size}-{weight}
, medium
or bold
, when you want to adjust the font's weight.
Heading Type | Example |
---|---|
.text-type-1 .text-type-1-medium .text-type-1-bold | text-type-1 text-type-1-medium text-type-1-bold |
.text-type-2 | text-type-2 |
.text-type-3 | text-type-3 |
.text-type-4 | text-type-4 |
.text-type-5 | text-type-5 |
.text-type-6 | text-type-6 |
.text-type-7 | text-type-7 |
Text alignment
Text can be realigned with components by using text alignment classes. There are responsive classes for left, right, and center alignments that use the same viewport width breakpoints as the grid system text-{size}-{align}
for sm
, md
, lg
, and xl
.
Example
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi ad doloremque rem quasi voluptatum temporibus voluptates non unde, veritatis molestias velit impedit iste tenetur officiis et quae nisi facilis atque!
Left aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
Right aligned text on all viewport sizes.
Bold text.
Normal weight text.
Italic text.
Text wrapping and overflow
You can have text wrap with a `.text-wrap` class.
Sometimes, you need to stop text from wrapping, such as when you want the text of two elements to be on the same line. In this case, you can use the .text-nowrap
class to keep text from wrapping.
Text transform
When you need to capitalize text in sentence case, you can use the text capitalization class text-capitalize
. This puts the first letter in every word in uppercase, while the rest of the letters will be in lowercase.
Font utilities
When you need to change a text's weight or style, use the following classes:
font-weight-bold
for bold textfont-italic
for italic textfont-weight-normal
for normal weight text
Do you have an idea, or want to help us improve this page? Reach out to us via email.
DTMB-DG-Support@michigan.govNeed help? Visit our Support page to learn how to get assistance, troubleshoot issues, and connect with the team.