Skip to content

Instantly share code, notes, and snippets.

@pcalves
Created September 2, 2015 11:33
Show Gist options
  • Save pcalves/3e5fe1edc8ac9770d796 to your computer and use it in GitHub Desktop.
Save pcalves/3e5fe1edc8ac9770d796 to your computer and use it in GitHub Desktop.
Simple grids. Infinite ❤️ & all credit to Chris Coyier. (https://css-tricks.com/dont-overthink-it-grids/)
.grid { width: auto; }
.grid:after {
content: "";
display: table;
clear: both;
}
[class*='col-'] {
float: left;
padding-right: 1.5em;
margin-top: 0;
}
[class*='col-']:last-of-type { padding-right: 0; }
.col-1-2 { width: 50%; }
.col-1-3 { width: 33.33%; }
.col-2-3 { width: 66.66%; }
.col-1-4 { width: 25%; }
@media (max-width: 40em) {
[class*='col-'] { width: 100%; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment