Bootstrap 5 Basic
Bootstrap 5 Flexbox
Bootstrap 5 provides a range of typography utilities to help style and format text elements consistently.Here’s a quick overview:
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.
Use the .lead
class for highlighting introductory text or making paragraphs stand out.
Try it yourself
Bootstrap provides classes to align text easily:
.text-start
, .text-center
, and .text-end
.text-sm-start
, .text-md-center
, .text-lg-end
, etc.Try it yourself
.text-primary
, .text-secondary
, .text-success
, .text-danger
, .text-warning
, .text-info
, .text-light
, .text-dark
, .text-muted
, .text-white
Try it yourself
.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. |
.fw-bold
, .fw-bolder
, .fw-normal
.fw-light
, .fw-lighter
, for font weight..fst-italic
, .fst-normal
for italics.Try it yourself
Try it yourself
These line height class make it easy to adjust the spacing between lines of text without writing custom CSS.
lh-1
: Sets line height to 1
lh-sm
: Small line height, typically around 1.25
lh-base
: Default line height, usually 1.5
lh-lg
: Large line height, typically around 2
Try it yourself
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-auto
, overflow-hidden
, overflow-visible
, overflow-scroll
.Try it yourself
text-uppercase
: Uppercase text.text-lowercase
: Lowercase text.text-capitalize
: Capitalizes each wordTry it yourself