Grid System
Mon, June 29, 2026

Grid System

Bootstrap 5's powerful mobile-first flexbox grid. Use container, row, and column classes to build layouts of all shapes and sizes. Explore breakpoints, auto-layout columns, nesting, offsets, and ordering.

Grid Options
xs
<576px
sm
≥576px
md
≥768px
lg
≥992px
xl
≥1200px
xxl
≥1400px
Container max-width None (auto) 540px 720px 960px 1140px 1320px
Class prefix .col- .col-sm- .col-md- .col-lg- .col-xl- .col-xxl-
# of columns 12
Gutter width 1.5rem (24px) — left & right each 12px
Custom gutters Yes — via .g-*, .gx-*, .gy-*
Nestable Yes
Column ordering Yes — via .order-*
Equal Width Columns

Using .col without a number distributes columns equally across the available width.

1 Column
col
2 Columns
col
col
3 Columns
col
col
col
4 Columns
col
col
col
col
6 Columns
col
col
col
col
col
col
12 Columns (col-1 each)
1
2
3
4
5
6
7
8
9
10
11
12
Mixed Widths

Combine fixed-width and auto-width columns in the same row.

col-4 + col-8
col-4
col-8
col-3 + col-6 + col-3
col-3
col-6
col-3
col-2 + col + col-2
col-2
col (auto)
col-2
col-12 + col-6 + col-6
col-12
col-6
col-6
Responsive Breakpoints

Columns stack on mobile and expand at defined breakpoints. Resize the window to see them respond.

col-12 col-sm-6 col-lg-4
A
B
C
col-6 col-md-4 col-lg-3
col
col
col
col
col-12 col-md-6
col-12 / col-md-6
col-12 / col-md-6
Column Offsets

Use .offset-* to shift columns to the right by a given number of columns.

col-4 offset-4
col-4 offset-4
col-3 + col-3 offset-3
col-3
col-3 offset-3
col-6 offset-2
col-6 offset-2
col-4 + col-4 offset-4
col-4
col-4 offset-4
Column Ordering

Reorder columns visually using .order-* without changing the HTML source order.

order-3 · order-2 · order-1
First in HTML
order-3
Second in HTML
order-2
Third in HTML
order-1
order-first & order-last
1st — order-last
2nd — normal
3rd — order-first
Nested Grids

Add a new .row inside a column to nest the grid. The nested row creates a new 12-column grid scoped to its parent column.

OUTER col-8
inner col-6
inner col-6
col-4
col-4
col-4
OUTER col-4
inner col-12
col-6
col-6
Gutter Utilities

Control spacing between columns and rows with .g-*, .gx-* (horizontal), and .gy-* (vertical) classes from 0 to 5.

g-0 — No gutters
col
col
col
col
col
col
g-3 — Default gutters (1.5rem)
col
col
col
col
col
col
gx-5 gy-1 — Wide horizontal, tight vertical
col
col
col
col
col
gx-1 gy-4 — Tight horizontal, wide vertical
col
col
col
col
col