Bootstrap 5 Typography Fundamentals: Title Hierarchy and Text Style Settings

Bootstrap 5 Typography Utilities help standardize web text display. Their core functionalities are divided into title hierarchy and text styles. For title hierarchy, classes like `.h1` to `.h6` define headings of different sizes, maintaining style-semantic separation (e.g., `.h1` only modifies style without altering the semantic role of the tag). By default, these classes include `margin-bottom: 1rem` for spacing, automatically adjusting the gap between headings and body text. Text styles encompass alignment (`.text-start`/`.center`/`.end`/`.justify`), color (`.text-*`/`.bg-*`), weight (e.g., `fw-bold`, `fw-normal`), italics (`fst-italic`), case conversion (`.text-lowercase`/`.uppercase`/`.capitalize`), line height (`lh-sm`/`base`/`lg`), and spacing utility classes. Additionally, special styles include blockquotes (`.blockquote`), list-unstyled (removes list markers), and text-decoration-line-through. It’s crucial to prioritize semantics, distinguish classes from tags, and utilize responsive prefixes for device adaptation. Mastering core class names enables quick text beautification, and combining them with subsequent components yields better results.

Read More