The Bootstrap 5 grid system uses a 12-column flexbox layout to create responsive page structures. This page covers 5 grid patterns — basic, responsive, auto layout, nesting and offset — with visual examples.
Quick Setup
The grid system needs only Bootstrap 5 CSS:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
Key Classes Reference
| Class | What It Does |
|---|---|
.container | Fixed-width responsive container |
.container-fluid | Full-width container |
.row | Horizontal group of columns |
.col | Equal-width auto column |
.col-6 | Half-width column (6 of 12) |
.col-md-4 | 4-column width at md+ breakpoint |
.g-3 | Gap between columns and rows |
.gx-3 | Horizontal gap only |
.offset-md-3 | Push column 3 columns right |
.order-md-2 | Change column order |
1. Bootstrap 5 Basic Grid
The Bootstrap 5 grid is based on 12 columns. Columns must be inside a row inside a container.
2. Bootstrap 5 Responsive Grid
Columns change width at different breakpoints — full width on mobile, 2 cols on tablet, 3 on desktop.
3. Bootstrap 5 Auto Layout Columns
Use col without a number to automatically share equal width. Use col-auto to fit content size.
4. Bootstrap 5 Nested Grid
Grids can be nested by adding a new row inside a column. Each nested row has its own 12 columns.
5. Bootstrap 5 Offset Columns
Push columns to the right using offset-* classes. Useful for centered or asymmetric layouts.
Frequently Asked Questions
Need a Full Bootstrap 5 Admin Dashboard?
Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components — built by the same team behind BootstrapPlanet.
Browse Templates →Use code FIRST30 for 30% off your first purchase.