Text

Text Utilities

Canvas includes Bootstrap 5 text utilities plus its own extensions for size, letter spacing, and weight.

Alignment and wrapping

.text-start, .text-center, .text-end, plus responsive variants (.text-md-center). Wrapping: .text-nowrap, .text-truncate, .text-break.

Transform and style

Class Effect
.text-lowercase lowercase
.text-uppercase UPPERCASE
.text-capitalize Capitalize Each Word
.text-transform-none remove inherited transform
.fst-italic italic
.fst-normal normal style

Size

Canvas relative sizes:

Class Size
.text-larger 120% of current
.text-smaller 80% of current
.small Bootstrap small

Font weight

.fw-extralight, .fw-light, .fw-lighter, .fw-normal, .fw-medium, .fw-semibold, .fw-bold, .fw-bolder.

Line height

.lh-1, .lh-sm, .lh-base, .lh-lg.

Letter spacing (Canvas)

Class Spacing
.ls-0 0
.ls-1 1px
.ls-2 2px
.ls-3 3px
.ls-4 4px
.ls-5 5px

Color

.text-primary, .text-secondary, .text-body, .text-muted, .text-dark, .text-light, .text-reset, plus the contrast scale .text-contrast-0 to .text-contrast-1000.

Usage

<span class="text-uppercase ls-2 fw-semibold text-smaller text-muted">
  Overline label
</span>
<h2 class="fw-bold lh-sm">A tight, bold headline</h2>
<p class="text-larger text-body">Slightly larger lead paragraph.</p>

Classes

ClassDescription
.nottSets text-transform CSS property to none
.ls0Sets letter-spacing CSS property to 0px
.ls1Sets letter-spacing CSS property to 1px
.ls2Sets letter-spacing CSS property to 2px
.ls3Sets letter-spacing CSS property to 3px
.ls4Sets letter-spacing CSS property to 4px
.ls5Sets letter-spacing CSS property to 5px
.font-bodySets the current Body Font defined in css/fonts.css File
.font-primarySets the current Primary Font defined in css/fonts.css File
.font-secondarySets the current Secondary Font defined in css/fonts.css File
.fw-extralightSets the font-weight CSS property to 100
.fw-mediumSets the font-weight CSS property to 500
.fw-semiboldSets the font-weight CSS property to 600
.fw-normalSets the font-weight CSS property to normal
More Font Weight ClassesMore Font Weight Utility Classes can be found here: https://getbootstrap.com/docs/5.1/utilities/text/#font-weight-and-italics .
.text-smallerSets the font-size CSS property to 80% of the parent
.text-largerSets the font-size CSS property to 120% of the parent
Was this page helpful?