12 column grid

Responsive, simple, intuitive
CSS grid system built with flex

12
6
6
4
4
4
2
2
2
2
2
2
Get grid View docs

Examples

Don't forget to resize your window and use F12 to check all options of this grid!

1. The easiest way to use it - just add the class .flex_grid to the parent element. anchor

flex: 1
flex: 1
flex: 1
flex: 1

Without specifying classes to child div elements they will stand equally.

Because by default child of .flex_grid has style flex: 1;

2. You also have an option to specify grid in a mobile-first way. anchor

Use only for desktop .flex_grid__rwd

100% on tablet & mob
100% on tablet & mob
100% on tablet & mob

Use for desktop & tablet .flex_grid__mob

100% on mob
100% on mob
100% on mob
100% on mob

3. Basic customization of column width. anchor

Based on the 12-column system.

Classes: ._col_1, ._col_2, ._col_3, ._col_4, ._col_5, ._col_6, ._col_7, ._col_8, ._col_9, ._col_10, ._col_11, ._col_12

33.3%
41.7%
25%

4. Easily configure the gap between columns. anchor

Just assign new value to --grid-gap property of current .flex_grid container. Default gap is 20px

gap 10px
gap 10px
gap 10px
gap 10px
gap 10px
gap 10px
gap 10px
gap 10px

5. Use the flexibility of flex: 1; anchor

There is an option to add a class only to one child element and let another fill the rest of the space.

It could be useful for default article & aside combination.

article

6. Change the column width for a tablet. anchor

* Note that this width will stay for mobile if you won't specify for mobile separately.

Just apply additional child classes like .__50_rwd to specify the new width.

Classes:
.__rwd = flex: 1;,
.__25_rwd = width: 25%;,
.__33_rwd = width: 33.3%;,
.__50_rwd = width: 50%;,
.__full_rwd = width: 100%;

16.7%50% on tablet
25%50% on tablet
16.7%100% on tablet
16.7%33.3% on tablet
25%flex: 1 on tablet

* Tablet breakpoint starts on 1024px

7. Change the column width for a mobile. anchor

* Pretty much the same logic as for tablet.

Just apply additional child classes like .__50_mob to specify the new width.

Classes:
.__mob = flex: 1;,
.__25_mob = width: 25%;,
.__33_mob = width: 33.3%;,
.__50_mob = width: 50%;,
.__full_mob = width: 100%;

16.7%33.3% on tablet50% on mob
16.7%33.3% on tablet50% on mob
16.7%33.3% on tablet100% on mob
16.7%33.3% on tablet50% on mob
16.7%33.3% on tablet50% on mob
16.7%33.3% on tablet100% on mob

* Mobile breakpoint starts on 767px

8. More complex example. anchor

* Try to resize the window.

33.3% 33.3% 50%
33.3% flex: 1 50%
33.3% 25% 33.3%
100% 50% flex: 1
16.7% 25% 100%
16.7% 25% 50%
16.7% 25% 50%
16.7% 25% 25%
16.7% 50% 33.3%
16.7% 50% flex: 1
25% flex: 1 100%
25% 33.3% 50%
25% 33.3% flex: 1
25% flex: 1 flex: 1