Created
September 2, 2015 11:33
-
-
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/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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