Gutters
Gutters are the gaps between columns. Change them on the row: g-0 (none) to g-5 (large). Use gx-* for horizontal and gy-* for vertical only.
Offset
offset-md-2 pushes a column right by 2 columns. Great for centring: col-md-6 offset-md-3.
Order
order-1, order-2, order-last change visual order — for example, show an image first on mobile and second on desktop.
Row columns
row-cols-1 row-cols-md-3 — every child becomes one column on phones and three per row on tablets. Perfect for card grids.
Alignment
- Vertical:
align-items-centeron the row - Horizontal:
justify-content-center,justify-content-between
Nesting
Put a new .row inside a column to split it again into 12.
Example
Example — row-cols, gutters, offset and order
HTML
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<div class="container my-3">
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-4 g-3 mb-4">
<div class="col"><div class="p-3 bg-info-subtle border">Card 1</div></div>
<div class="col"><div class="p-3 bg-info-subtle border">Card 2</div></div>
<div class="col"><div class="p-3 bg-info-subtle border">Card 3</div></div>
<div class="col"><div class="p-3 bg-info-subtle border">Card 4</div></div>
</div>
<div class="row mb-4">
<div class="col-md-6 offset-md-3 p-3 bg-warning-subtle border text-center">Centred with offset-md-3</div>
</div>
<div class="row align-items-center">
<div class="col-md-6 order-md-2 p-4 bg-success text-white">Image (first on mobile, right on desktop)</div>
<div class="col-md-6 order-md-1 p-3">Text column</div>
</div>
</div>