Bootstrap uses Flexbox for its grid layout, supporting up to 12 columns across the entire page.
If you don't need to use all 12 columns separately, you can combine multiple columns to form broader sections.
The grid system is responsive, and the columns will re-arrange automatically depending on the screen size.
Make sure that the sum adds up to 12 or fewer (it is not required that you use all 12 available columns).
The Bootstrap 5 grid system has six classes:
The classes above can be combined to create more dynamic and flexible layouts.
<!-- Control the column width, and how they should appear on different devices --> <div class="row"> <div class="col-*-*"></div> <div class="col-*-*"></div> </div> <div class="row"> <div class="col-*-*"></div> <div class="col-*-*"></div> <div class="col-*-*"></div> </div> <!-- Or let Bootstrap automatically handle the layout --> <div class="row"> <div class="col"></div> <div class="col"></div> <div class="col"></div> </div>
Class | Breakpoint | Description |
---|---|---|
.col |
Auto | Auto-distributes available space evenly |
.col-sm-3 |
Small (≥576px) | Occupies 3 of 12 columns on small and larger screens |
The example below demonstrates how to make four columns with equal width starting from tablet-sized screens and up to extra-large desktops. On smaller screens (less than 576px), these columns will stack vertically by default.
This example demonstrates how to create two columns of different widths starting from tablet-sized screens and adjusting up to large desktop displays.