What is grid system in bootstrap?

Solution

Bootstrap provides a responsive grid system that appropriately scales up to 12 columns as the device or viewport size increases. To create a responsive layout using bootstrap 12 column structure these points need to be considered

  • All the rows must be placed inside of a div having class .container or .container-fluid
  • Create a div having class .row to group column
  • Add columns inside row as immediate children of row 
  • Place all content inside columns
  • There are pre-defined classes for columns. These classes are col-md-*, col-sm-*, col-lg-*, col-sx-*where * represent number from 1 to 12. These classes take effect as per viewport of the device.

Below diagram describes the simple layout of a web page.

if a row has column with class .col-sm-4 then it mean it will occupy first 4 column for small device and full width in extra small device.

similarly column with class .col-sm-8 will occupy next 8 column in the row and full width for extra small device.

Bootstrap grid structure

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media