Bootstrap 5 TutorialLesson 31Free preview
BS5 Utilities
This lesson is part of Bootstrap · All levels
Summary
Bootstrap 5 provides a class of ready-to-use utilities for general needs such as distance (.m-* and .p-*), display (.d-none), text (.fw-bold), and color (.bg-*). Utility can be combined with a responsive breakpoint, e.g. .d-none.d-md-block so that the element appears only on the upper medium screen. This approach reduces manual CSS writing.
Key points
- Distance utility: .m-* (margin) and .p-* (padding) on a scale of 0 to 5.
- Directions are available: .mt-, .mb-, .ms-, .me-, .mx-, .my-.
- .d-none hides the element; .d-block or .d-flex displays it.
- Responsive: add breakpoints such as .d-none.d-lg-block.
- .fw-bold and .fw-light set the thickness; .fst-italic set the slope.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.