Bootstrap is a really powerful framework and was developed by Twitter and makes websites responsive.
Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the Web. This webpage has been developed using Bootstrap.
Containers are the most basic layout in Bootstrap element and are required when using their Grid system.
There are two types of conatiners:
A horizontal row in Bootstrap is made up of 12 columns. So we can create sections of a row up to 12 columns total before it wraps around. In the example below we create four columns, the first is 4 columns wide, second and third are 3 columns, and the fourth is 2 columns wide.
By default in Bootsrap there are 4 responsive breakpoints (xs, sm, md, lg, xl). The second attribute of grid class, for e.g. 'sm' in 'col-sm-4' deonotes the grid should occupy 4 columns in a viewport of that size and larger, AND if the size, in this example falls under a small then the column should stack (meaning take up the entire width of the viewport).
Having said that, we can combine as to when columns should stack. In the example below we have:
It is not necessary that a grid has to collapse. In other words it is also possible to make the same grid take up differen sizes in different viewport. To illustrate this I have modified the example above as following:
It is possible to move columns to the right, in other words add gaps in between columns. Columns can be moved to the right using .col-*-offset-* class. The first asterisk can be replaced with the viewport (xs, sm, md, lg, xl) and the second asterisk with the number of columns to offset. For example, .col-md-offset-2 will offset the grid by 2 columns in viewport of medium size and larger. In the following example the 2nd grid has been offset by 2 columns in viewports of mediumd and larger.
It is possible to nest a grid within a grid. To nest your content with the default grid, add a new .row and set of columns (.col-*-*) within an existing column (.col-*-*). Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 columns).