Grid System
Extra small <576px |
Small ≥576px |
Medium ≥768px |
Large ≥992px |
Extra large ≥1200px |
|
---|---|---|---|---|---|
Max container width | None (auto) | 540px | 720px | 960px | 1140px |
Class prefix | .col- |
.col-sm- |
.col-md- |
.col-lg- |
.col-xl- |
# of columns | 12 | ||||
Gutter width | 30px (15px on each side of a column) | ||||
Nestable | Yes | ||||
Column ordering | Yes |
Equal Width
For example, here are two grid layouts that apply to every device and viewport, from
Multi row
One column with fixed width use predefine grid classes or inline width
xs
to xl
. Add any number of unit-less classes for each breakpoint you need and every column will be the same width.
1 of 2
2 of 2
1 of 3
2 of 3
3 of 3
col
col
col
col
1 of 3
2 of 3 (wider)
3 of 3
Mix and Match
Don’t want your columns to simply stack in some grid tiers? Use a combination of different classes for each tier as needed. See the example below for a better idea of how it all works.
.col-12 .col-md-8
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-6
.col-6
On Gutters and Reordering
The gutters between columns in our predefined grid classes can be removed with
Use
.no-gutters
. This removes the negative margins from .row
and the horizontal padding from all immediate children columns.
.col-12 .col-sm-6 .col-md-8
.col-6 .col-md-4
.order-
classes for controlling the visual order of your content. These classes are responsive, so you can set the order by breakpoint (e.g., .order-1.order-md-2). Includes support for 1 through 12 across all five grid tiers.
First, but unordered
Second, but last
Third, but first
First, but last
Second, but unordered
Third, but first
Offset Classes
Move columns to the right using
.offset-md-*
classes. These classes increase the left margin of a column by * columns. For example, .offset-md-4
moves .col-md-4
over four columns.
.col-md-4
.col-md-4 .offset-md-4
.col-md-3 .offset-md-3
.col-md-3 .offset-md-3
.col-md-6 .offset-md-3
Responsive Classes
Customize the size of your columns on extra small, small, medium, large, or extra large devices however you see fit.
For grids that are the same from the smallest of devices to the largest, use the
Using a single set of
.col
and .col-*
classes. Specify a numbered class when you need a particularly sized column; otherwise, feel free to stick to .col
.
col
col
col
col
col-8
col-4
.col-sm-*
classes, you can create a basic grid system that starts out stacked and becomes horizontal at the small breakpoint (sm).
col-sm-8
col-sm-4
col-sm
col-sm
col-sm
Alignment
Use flexbox alignment utilities to vertically and horizontally align columns.
Vertical alignment
Horizontal alignment
Col
Col
Col
Col
Col
Col
Col
Col
Col
Col
Col
Col
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns
1 of 2 columns