Typography
Typography in Bootstrap 5 covers the default styles for headings, paragraphs, lists and quotes, plus utility classes for size, weight, alignment and case. Bootstrap's Reboot stylesheet gives every page a consistent base font stack and spacing, and the typography classes let you adjust text without writing your own CSS. You use them whenever you need text to look a certain way while keeping your HTML meaningful.
Headings: tags for meaning, classes for looks
The tags <h1> to <h6> are already styled. Bootstrap also offers the classes .h1 to .h6, which make any element look like a heading of that level. This lets you keep the correct document structure for screen readers and search engines while choosing a different visual size.
For big, eye-catching titles there are display headings, .display-1 through .display-6. They are larger and lighter than normal headings and work well in hero sections. Bootstrap's responsive font sizing scales these down on narrow screens automatically.
<h1 class="display-4">Learn to Build Websites</h1>
<p class="lead">Short, practical lessons that start from zero.</p>
<h2 class="h4">Section title that looks smaller</h2>
<p>
Regular paragraph with <mark>highlighted</mark> text and
<small>fine print</small>.
</p>
<p class="text-center fw-semibold text-uppercase">Centered bold caps</p>
<p class="fst-italic text-body-secondary">Muted italic note</p>
Text utilities you will use daily
Bootstrap 5 replaced several older class names, so tutorials written for Bootstrap 4 may not match. The current ones are:
| Purpose | Classes |
|---|---|
| Alignment | text-start, text-center, text-end, and responsive forms like text-md-start |
| Weight | fw-light, fw-normal, fw-semibold, fw-bold |
| Style | fst-italic, fst-normal |
| Case | text-lowercase, text-uppercase, text-capitalize |
| Size | fs-1 to fs-6 |
| Line height | lh-1, lh-sm, lh-base, lh-lg |
| Wrapping | text-wrap, text-nowrap, text-truncate, text-break |
Note that text-left and text-right from Bootstrap 4 became text-start and text-end, which also work correctly for right-to-left languages. Similarly, font-weight-bold became fw-bold and font-italic became fst-italic.
For muted, secondary text, Bootstrap 5.3 recommends text-body-secondary, which adapts to light and dark colour modes. The older text-muted still works but is deprecated. If you need truncation with an ellipsis, remember that text-truncate only works on block or inline-block elements with a limited width.
Lists and blockquotes
.list-unstyled removes bullets and left padding, useful for link lists in footers. .list-inline on the list plus .list-inline-item on each item puts items on one line. For quotes, wrap a <blockquote class="blockquote"> inside a <figure> and add a <figcaption class="blockquote-footer"> for the source.
A frequent mistake: picking heading tags by size
Many beginners use <h4> just because they want smaller bold text, or skip from <h1> to <h5>. This breaks the page outline that assistive technology uses to navigate. Choose the heading level that matches the content's position in the page, then use .h1–.h6 or fs-* to change its size. Likewise, do not use a heading tag for text that is not a heading; style a paragraph with fw-bold instead.
In short
- Use tags for structure and Bootstrap classes for appearance.
- Use
display-*andleadfor hero text. - Learn the Bootstrap 5 names:
fw-*,fst-*,fs-*,text-start/text-end.
Ready to master real-world web development?
Learn HTML, CSS3, Bootstrap and JavaScript hands-on with mentor-led sessions.