elibraryportal Logo

Bootstrap Grids or Columns Section

Bootstrap's grid provides 12 columns across the page

span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1
 span 4  span 4  span 4
span 4 span 8
span 6 span 6
span 12

Types of Grid Classes

There are 4 types of Grid Classes

  • .col:- (extra small devices - screen width less than 576px)
  • .col-sm :- (small devices - screen width equal to or greater than 576px)
  • .col-md :- (medium devices - screen width equal to or greater than 768px)
  • .col-lg :- (large devices - screen width equal to or greater than 992px)
  • .col-xl :- (xlarge devices - screen width equal to or greater than 1200px)

Note:-It set the same widths for sm & md, you only need to specify sm.


Basic Structure of a Bootstrap Grid System

Syntax:-

Three Equal Columns Example

.col
.col
.col

Example:-

Test it Now

Responsive Columns Example

.col-sm-3
.col-sm-3
.col-sm-3
.col-sm-3

Example:-

Test it Now

Two Unequal Responsive Columns

.col-sm-4
.col-sm-8

Example:-

Test it Now