Grid Calculator

grid-calculator

The grid calculator is a quick an easy tool to use when you're building fluid layouts. Just enter your layout width, number of columns, and your gutter and copy the css!

Speed up your workflow with the Grid Calculator

css fluid grids

FLUID GRIDS

Make grids from 2 to 14 columns and gutters from 8 to 40 pixels and the grid calculator churns out the numbers.

css responsive grids

RESPONSIVE

This grid calculator was built to help front end developers who want to quickly deploy fluid percentage based layouts.

download responsive grid css

GENERATED CSS

Reduce the time it takes to develop your fluid layouts with css you can copy and paste and add to your css project file.

Create your own quick grids to plug into your design projects.







Basic Setup

Include the border-box rule at the top of your css file to target all the elements. Border-box is a great way of controlling margins and padding within containers and divs. If you're interested in learning more about why this piece of code is usefull check out Paul Irish's article explaing the benefits of applying this rule to your css.

To seperate your column rows insert your grid columns inside a containing row. The class name is really up to you. Use the cleafix hack developed by Nicolas Gallagher when you add additional rows to clear collapsing floats. The clearfix is an effective way to keep your floating divs in the normal flow of the page layout.

In this example, a column name begins with .col_ followed by the column span number. Your column names can use other naming conventions like .span_col_1 if you prefer.

Grid Essentials

Grid columns float left with right margins set to margin-right:-100%; for container-relative floats. For each consecutive grid column the margins are set from left edge of the container using the .pad class.

Media Queries

Apply media queries at certain breakpoints for a fluid responsive layout. Go from 12 columns to 6 to 1. Here we reset our grids to 100% for all columns for various device breakpoints

Full 12 Column Fluid Responsive Grid Columns

Sample 12 Column Grid

Nested Fluid Responsive Grid Columns

Sample Nested Column Grid

Source Order Fluid Responsive Grid Columns

Source Order Column Grid

Spread Joy!

Fork It!