BS5 Grid Small
Small Grid Example
 | XSmall | Small | Medium | Large | Extra Large | XXL |
---|---|---|---|---|---|---|
Class prefix | .col- | .col-sm- | .col-md- | .col-lg- | .col-xl- | .col-xxl- |
Screen width | <576px | >=576px | >=768px | >=992px | >=1200px | >=1400px |
Let’s say we have a straightforward two-column layout. For small devices, we want the columns to be divided into 25% and 75%.
A gadget is considered small if its screen width is between 576 and 767 pixels.
We shall utilize the .col-sm-* classes for tiny devices.
The classes listed below will be added to our two columns:
....
....
A 25%/75% split will occur on small, medium, big, xlarge, and xxlarge devices based on the following example. On exceptionally tiny devices, it will stack automatically (100%):
.col-sm-3
.col-sm-9
Example
Lorem ipsum...
Sed ut perspiciatis...
Note: You do not have to use all 12 of the available columns; just make sure the total comes up to 12 or less.
You would use .col-sm-4 and .col-sm-8 for a 33.3%/66.6% split (and .col-sm-6 and .col-sm-6) for a 50%/50% split:
.col-sm-4
.col-sm-8
.col-sm-6
.col-sm-6
Example
Lorem ipsum...
Sed ut perspiciatis...
Lorem ipsum...
Sed ut perspiciatis...
Auto Layout Columns
One simple method to achieve equal width columns on all devices using Bootstrap 4 is to remove the number from .col-sm-* and use the .col-sm class solely on a predetermined number of col elements. Bootstrap will determine the number of columns and set the width of each column to match.
Less than 576px on the screen will cause the columns to stack horizontally:
1 of 2
2 of 2
1 of 4
2 of 4
3 of 4
4 of 4