Responsive CSS only grid with fluid columns and fixed-width gutters Browser support from IE8+ (Responsive support from IE9+)
Instructions
This grid follows these breakpoints:
320 (320-479), 480 (480-767), 768 (768-959)
Classes used:
- hide-768, hide-480, hide-320
- Hide the element at that breakpoint. Supported breakpoints: 320-479, 480-767, 768-959
- grid
- Add this class to the containing element. If should only have <divs> as its direct children, each with one of the following classes:
- col-16, col-20, col-25, col-30, col-33, col-40, col-50, col-60, col-66, col-70, col-75, col-80, col-83, col-100
- The possible column widths. Place these on the direct children of the container .grid
- full-768, full-480, full-320
- Add to the containing element to make all of its children full width at that breakpoint.
- padded
- Add this class to the containing element. It will add the padding to the container equal to the gutter width. See examples
- no-gutters
- Add this class to the containing element. It will remove all gutters from the children. See examples
- col-right
- Add this onto one of the columns. It will allow for splitting a column to go the top or bottom on mobile screens. See examples
Examples
Division Points
16.666%
83.333% full @768px
20%
80% full @768px
25%
75% full @480px
30%
70% full @480
33.333%
66.666% full @480
40%
60% full @320px
50%
50%
75%
25%
Padded Examples:
16.666%
83.333% padded, full @480px
20%
80% padded, full @480px
25%
75% padded, full @480px
30%
70% padded, full @480px
33.333%
66.666% padded, full @480px
40% padded
60% padded
50% padded
50% padded
100% padded
Combinations
They can be put together in any combination that adds up to 100 (99 rounds up to 100):
33%
33%
33%
50%
33% of 50%
33% of 50%
33% of 50%
25%
25%
50%
16.666%
66.666%
16.666%
Remove the Gutters
20%
20%
20%
20%
20%
16.666%
66.666%
16.666%
25%
50%
25%
Alternate Wrapping
You can make columns wrap to the top or bottom:
33% top, full @480px
66.666% middle, full @480px
Shrink the screen to below 767 to see how these wrap differently.
33% bottom, full @480px
33% top, full @320px
66.666% middle, full @320px
33% bottom, full @320px
25% top, full @480px
75% middle, full @480px
25% bottom, full @480px
25% full @768px
75% full @768px
25% full @768px
25% top, full @480px
25% middle, full @480px
75% bottom, full @480px
Hiding Content
And, of course, you can simply make columns disappear at our breakpoints as well.
B. Hide A @768px
B. Hide A @768px
C. Hide A @768px
A. Hide B @768px
C. Hide B @768px
A. Hide C @768px
B. Hide C @768px
B. Hide A @480px
C. Hide A @480px
A. Hide B @480px
C. Hide B @480px
A. Hide C @480px
B. Hide C @480px
B. Hide A @320px
C. Hide A @320px
A. Hide B @320px
C. Hide B @320px
A. Hide C @320px
B. Hide C @320px
Stacked Examples
1/4 to 1/2
1/4 to 1/2
1/4 to 1/2
1/4 to 1/2
1/4 to 1/2 to 1
1/4 to 1/2 to 1
1/4 to 1/2 to 1
1/4 to 1/2 to 1
1/4 to 1/2
1/4 to 1/2
1/4 to 1/2
1/4 to 1/2
1/6 to 1/3
1/6 to 1/3
1/6 to 1/3
1/6 to 1/3
1/6 to 1/3
1/6 to 1/3