
Bs5 Grid Small in Bootstrap
Got it! Here's a concise guide on Bootstrap 5 Grid Small (.col-sm-*
) — perfect for small screens (?576px).
? Bootstrap 5 .col-sm-*
Grid Basics
.col-sm-*
classes apply at small devices and up, meaning screens 576px wide or wider.On screens smaller than 576px (extra small), columns stack vertically (full width) unless
.col-*
(no breakpoint) or other smaller classes are used.
? Basic .col-sm-*
Example
<div class="container"> <div class="row"> <div class="col-sm-6">Half width on small+</div> <div class="col-sm-6">Half width on small+</div> </div></div>
On screens ?576px, columns take half width each.
On smaller screens, columns stack.
? Responsive Mixed Breakpoints
<div class="container"> <div class="row"> <div class="col-12 col-sm-8">Full width xs, two-thirds width sm+</div> <div class="col-6 col-sm-4">Half width xs, one-third width sm+</div> </div></div>
? Offsets on Small Screens .offset-sm-*
<div class="container"> <div class="row"> <div class="col-sm-4 offset-sm-4">Centered on small+</div> </div></div>
? Ordering on Small Screens .order-sm-*
<div class="container"> <div class="row"> <div class="col-sm-4 order-sm-3">Third on small+</div> <div class="col-sm-4 order-sm-1">First on small+</div> <div class="col-sm-4 order-sm-2">Second on small+</div> </div></div>
Recap for .col-sm-*
classes
Class | Applies from | Description |
---|---|---|
.col-sm-* | ? 576px | Column width on small+ |
.offset-sm-* | ? 576px | Offset column on small+ |
.order-sm-* | ? 576px | Change order on small+ |
Bonus: Auto-layout on Small Screens
<div class="row"> <div class="col-sm">Equal width col 1</div> <div class="col-sm">Equal width col 2</div> <div class="col-sm">Equal width col 3</div></div>
Columns share space equally on small+ screens.
Want me to show examples combining small with other breakpoints, or full responsive layout templates?