Advertisement
Google Ad Slot: content-top
Bootstrap 5 Text/Typography
Bootstrap 5 provides a range of typography utilities to help style and format text elements consistently.Here’s a quick overview:
Headings
Bootstrap provides classes for all HTML heading elements (<h1> to <h6>) for easy typography customization. You can use these directly or apply classes to any element to make it look like a heading.
Lead Text:
Use the .lead class for highlighting introductory text or making paragraphs stand out.
Text Alignment:
Bootstrap provides classes to align text easily:
.text-start,.text-center, and.text-end- For responsive alignment, use
.text-sm-start,.text-md-center,.text-lg-end, etc.
Text Color
- You can apply text color with these classes:
.text-primary,.text-secondary,.text-success,.text-danger,.text-warning,.text-info,.text-light,.text-dark,.text-muted,.text-white
Font Size:
.fs-1 to .fs-6 can adjust font sizes responsively.
Class |
Font Size (Default) |
Description |
|---|---|---|
fs-1 |
|
Largest font size. |
fs-2 |
|
Second largest font size. |
fs-3 |
|
Medium-large font size. |
fs-4 |
|
Medium font size. |
fs-5 |
|
Smaller medium font size. |
fs-6 |
|
Default font size. |
Font Weight and Italics:
.fw-bold,.fw-bolder,.fw-normal.fw-light,.fw-lighter, for font weight..fst-italic,.fst-normalfor italics.
Line Height:
These line height class make it easy to adjust the spacing between lines of text without writing custom CSS.
lh-1: Sets line height to1lh-sm: Small line height, typically around1.25lh-base: Default line height, usually1.5lh-lg: Large line height, typically around2
Text Wrapping and Overflow:
text-wrap: Allows text to wrap within the container.text-nowrap: Prevents text from wrapping.text-truncate: Truncates text with an ellipsis if it exceeds container width.- Overflow: Control overflow with
overflow-auto,overflow-hidden,overflow-visible,overflow-scroll.
Text Transformation:
text-uppercase: Uppercase text.text-lowercase: Lowercase text.text-capitalize: Capitalizes each word