Typography
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Spacing on Bootstrap<p class="text-start">Start aligned text on all viewport sizes.</p>
<p class="text-center">Center aligned text on all viewport sizes.</p>
<p class="text-end">End aligned text on all viewport sizes.</p>
<p class="text-sm-start">Start aligned text on viewports sized SM (small) or wider.</p>
<p class="text-md-start">Start aligned text on viewports sized MD (medium) or wider.</p>
<p class="text-lg-start">Start aligned text on viewports sized LG (large) or wider.</p>
<p class="text-xl-start">Start aligned text on viewports sized XL (extra-large) or wider.</p>
Start aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
End aligned text on all viewport sizes.
Start aligned text on viewports sized SM (small) or wider.
Start aligned text on viewports sized MD (medium) or wider.
Start aligned text on viewports sized LG (large) or wider.
Start aligned text on viewports sized XL (extra-large) or wider.
<div class="badge text-bg-primary text-wrap mb-3" style="width: 6rem;">This text should wrap.</div>
<div class="text-nowrap bg-body-tertiary" style="width: 8rem;">This text should overflow the parent.</div>
Word break
Prevent long strings of text from breaking your component's layout by using .text-break
to set word-wrap: break-word
and word-break: break-word
. We use word-wrap
instead of the more common overflow-wrap
for wider browser support, and add the deprecated word-break: break-word
to avoid issues with flex containers.
<p class="text-break">mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm</p>
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="text-capitalize">CapiTaliZed text.</p>
Lowercased text.
Uppercased text.
CapiTaliZed text.
<h6 class="fs-10">.fs-10</h6>
<h6 class="fs-9">.fs-9</h6>
<h6 class="fs-8">.fs-8</h6>
<h6 class="fs-7">.fs-7</h6>
<h6 class="fs-6">.fs-6</h6>
<h6 class="fs-5">.fs-5</h6>
<h6 class="fs-4">.fs-4</h6>
<h6 class="fs-3">.fs-3</h6>
<h6 class="fs-2">.fs-2</h6>
<h6 class="fs-1">.fs-1</h6>
<h6 class="fs-8">.fs-8</h6>
<div class="mt-3">
<h6 class="fs-sm-8">.fs-sm-8</h6>
<h6 class="fs-md-7">.fs-md-7</h6>
<h6 class="fs-lg-7">.fs-lg-7</h6>
<h6 class="fs-xl-5">.fs-xl-5</h6>
</div>
.fs-10
.fs-9
.fs-8
.fs-7
.fs-6
.fs-5
.fs-4
.fs-3
.fs-2
.fs-1
.fs-8
.fs-sm-8
.fs-md-7
.fs-lg-7
.fs-xl-5
<div class="fw-light">Font weight 300</div>
<div class="fw-normal">Font weight 400</div>
<div class="fw-medium">Font weight 500</div>
<div class="fw-semibold">Font weight 600</div>
<div class="fw-bold">Font weight 700</div>
<div class="fw-bolder">Font weight 800</div>
<div class="fw-black">Font weight 900</div>
<p class="lh-1">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
</p>
<p class="lh-sm">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-base">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-lg">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
<h1>h1. Heading</h1>
<h2>h2. Heading</h2>
<h3>h3. Heading</h3>
<h4>h4. Heading</h4>
<h5>h5. Heading</h5>
<h6>h6. Heading</h6>
h1. Heading
h2. Heading
h3. Heading
h4. Heading
h5. Heading
h6. Heading
<p class="h1">h1. Heading</p>
<p class="h2">h2. Heading</p>
<p class="h3">h3. Heading</p>
<p class="h4">h4. Heading</p>
<p class="h5">h5. Heading</p>
<p class="h6">h6. Heading</p>
h1. Heading
h2. Heading
h3. Heading
h4. Heading
h5. Heading
h6. Heading
<h1 class="display-1 mb-3">Display 1</h1>
<h1 class="display-2 mb-3">Display 2</h1>
<h1 class="display-3 mb-3">Display 3</h1>
<h1 class="display-4 mb-3">Display 4</h1>
<h1 class="display-5 mb-3">Display 5</h1>
<h1 class="display-6 mb-3">Display 6</h1>
Display 1
Display 2
Display 3
Display 4
Display 5
Display 6
<p>Nunito sans</p>
<code class="text-monospace">Monospace</code>
Nunito sans
Monospace
<p class="text-muted">Muted text with a <a class="text-reset" href="#">reset link</a>.</p>
Muted text with a reset link.
<p class="text-decoration-underline">This text has a line underneath it.</p>
<p class="text-decoration-line-through">This text has a line going through it.</p>
<a class="text-decoration-none" href="#">This link has its text decoration removed</a>
This text has a line underneath it.
This text has a line going through it.
This link has its text decoration removed