BBS5 Utilities
Learn about Bootstrap 5 utility classes.
BS5 Utilities
Bootstrap 5 consists of dozens of utility classes for simple and fast styling without writing CSS code.
Borders
Use .border, .border-0, .border-top-0, etc. to manage borders.
Use .border-primary, .border-white, etc. to color borders.
Use .rounded, .rounded-circle, .rounded-pill for border radius.
Spacing
Bootstrap 5 offers a wide range of responsive margin and padding utility classes.
The classes are named using the format {property}{sides}-{size}.
- Property:
m(margin),p(padding) - Sides:
t(top),b(bottom),s(start),e(end),x(left&right),y(top&bottom), blank (all 4 sides) - Size: 0, 1, 2, 3, 4, 5, auto
Shadows
Use .shadow-none, .shadow-sm, .shadow, .shadow-lg to add box-shadows.
Examples
Borders
html/cssStyling borders.
<span class="border"></span>
<span class="border border-0"></span>
<span class="border border-top-0"></span>
<span class="border border-end-0"></span>
<span class="border border-bottom-0"></span>
<span class="border border-start-0"></span>
<br>
<span class="border border-primary"></span>
<span class="rounded"></span>
<span class="rounded-circle"></span>Spacing (Margin and Padding)
html/cssShadows
html/css