Fork me on GitHub

Grid examples

Basic grid layouts to get you familiar with using grid system.

Installation

Install with npm  npm install grid-styled-css --save

Basic understanding

The basic understanding for rendering grid is the sumation of the used columns which should always be eqaul to 12.

Consider rendering grid using class .col-4.col-6.col-2. In this sample the summation is 4 + 6 + 2 = 12 so the grid would render properly. So always take care column sumation.

Five grid tiers

There are five tiers to the grid system. Each tier starts at a minimum viewport size and automatically applies to the larger devices unless overridden.

.col-4
.col-4
.col-4
.col-sm-4
.col-sm-4
.col-sm-4
.col-md-4
.col-md-4
.col-md-4
.col-lg-4
.col-lg-4
.col-lg-4
.col-xl-4
.col-xl-4
.col-xl-4

Three equal columns

Get three equal-width columns. On mobile devices, tablets and below, the columns will automatically stack.

.col-md-4
.col-md-4
.col-md-4

Three unequal columns

Get three columns of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.

.col-md-3
.col-md-6
.col-md-3

Two columns

Get two columns.

.col-md-8
.col-md-4