Documentation and examples for Bootstrap typography, including global settings, headings, body text, lists, and more.
Headings
All HTML headings,
through
, are available.
Customizing headings
Use the included utility classes to recreate the small secondary heading text from Bootstrap 3.
Display headings
Traditional heading elements are designed to work best in the meat of your page content. When you need a heading to stand out, consider using a display heading—a larger, slightly more opinionated heading style.
Display headings are configured via the $display-font-sizes Sass map and two variables, $display-font-weight and $display-line-height.
Display headings are customizable via two variables, $display-font-family and $display-font-style.
Lead
Make a paragraph stand out by adding .lead.
Inline text elements
Styling for common inline HTML5 elements.
Beware that those tags should be used for semantic purpose:
While not shown above, feel free to use and in HTML5. is meant to highlight words or phrases without conveying additional importance, while is mostly for voice, technical terms, etc.
Text utilities
Change text alignment, transform, style, weight, line-height, decoration and color with our text utilities and color utilities.
Abbreviations
Stylized implementation of HTML’s element for abbreviations and acronyms to show the expanded version on hover. Abbreviations have a default underline and gain a help cursor to provide additional context on hover and to users of assistive technologies.
Add .initialism to an abbreviation for a slightly smaller font-size.
Blockquotes
For quoting blocks of content from another source within your document. Wrap
around any HTML as the quote.
Naming a source
The HTML spec requires that blockquote attribution be placed outside the
. When providing attribution, wrap your
in a and use a or a block level element (e.g.,
) with the .blockquote-footer class. Be sure to wrap the name of the source work in as well.
Alignment
Use text utilities as needed to change the alignment of your blockquote.
Lists
Unstyled
Remove the default list-style and left margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.
Inline
Remove a list’s bullets and apply some light margin with a combination of two classes, .list-inline and .list-inline-item.
Description list alignment
Align terms and descriptions horizontally by using our grid system’s predefined classes (or semantic mixins). For longer terms, you can optionally add a .text-truncate class to truncate the text with an ellipsis.
Responsive font sizes
In Bootstrap 5, we’ve enabled responsive font sizes by default, allowing text to scale more naturally across device and viewport sizes. Have a look at the RFS page to find out how this works.
CSS
Sass variables
Headings have some dedicated variables for sizing and spacing.
Miscellaneous typography elements covered here and in Reboot also have dedicated variables.
Sass mixins
There are no dedicated mixins for typography, but Bootstrap does use Responsive Font Sizing (RFS).