Grid system
Bootstrap includes a powerful mobile-first grid system for building layouts of all shapes and sizes.
Extra small <34em | Small ≥34em | Medium ≥48em | Large ≥62em | Extra large ≥75em | |
---|---|---|---|---|---|
Grid behavior | Horizontal at all times | Collapsed to start, horizontal above breakpoints | |||
Container width | None (auto) | 34rem | 45rem | 60rem | 72.25rem |
Class prefix |
.col-xs-
|
.col-sm-
|
.col-md-
|
.col-lg-
|
.col-xl-
|
# of columns | 12 | ||||
Gutter width | 30px (15px on each side of a column) | ||||
Nestable | Yes | ||||
Offsets | Yes | ||||
Column ordering | Yes |
Grid examples
Mobile and desktop
Mobile, tablet, desktop
Column wrapping
Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.
Subsequent columns continue along the new line.
Responsive column resets
Offsetting columns
Nesting columns
Column ordering
Responsive utilities
Extra small devices Portrait phones (<34em) | Small devices Landscape phones (≥34em) | Medium devices Tablets (≥48em) | Large devices Desktops (≥62em) | Extra large devices Desktops (≥75em) | |
---|---|---|---|---|---|
.hidden-xs-down
|
Hidden | Visible | Visible | Visible | Visible |
.hidden-sm-down
|
Hidden | Hidden | Visible | Visible | Visible |
.hidden-md-down
|
Hidden | Hidden | Hidden | Visible | Visible |
.hidden-lg-down
|
Hidden | Hidden | Hidden | Hidden | Visible |
.hidden-xl-down
|
Hidden | Hidden | Hidden | Hidden | Hidden |
.hidden-xs-up
|
Hidden | Hidden | Hidden | Hidden | Hidden |
.hidden-sm-up
|
Visible | Hidden | Hidden | Hidden | Hidden |
.hidden-md-up
|
Visible | Visible | Hidden | Hidden | Hidden |
.hidden-lg-up
|
Visible | Visible | Visible | Hidden | Hidden |
.hidden-xl-up
|
Visible | Visible | Visible | Visible | Hidden |