Skip to content

Instantly share code, notes, and snippets.

@Vinze
Last active August 29, 2015 13:55
Show Gist options
  • Save Vinze/8777120 to your computer and use it in GitHub Desktop.
Save Vinze/8777120 to your computer and use it in GitHub Desktop.
Responsive grid test
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row:after {
content: "";
display: table;
clear: both;
}
.col {
display: inline-block;
float: left;
position: relative;
min-height: 10px;
margin-left: 2%;
}
.col:first-child {
margin-left: 0;
}
.span-1 { width: 6.5%; }
.span-2 { width: 15%; }
.span-3 { width: 23.5%; }
.span-4 { width: 32%; }
.span-5 { width: 40.5%; }
.span-6 { width: 49%; }
.span-7 { width: 57.5%; }
.span-8 { width: 66%; }
.span-9 { width: 74.5%; }
.span-10 { width: 83%; }
.span-11 { width: 91.5%; }
.span-12 { width: 100%; }
.offset-1 { margin-left: 10.5% !important; }
.offset-2 { margin-left: 19% !important; }
.offset-3 { margin-left: 27.5% !important; }
.offset-4 { margin-left: 36% !important; }
.offset-5 { margin-left: 44.5% !important; }
.offset-6 { margin-left: 53% !important; }
.offset-7 { margin-left: 61.5% !important; }
.offset-8 { margin-left: 70% !important; }
.offset-9 { margin-left: 78.5% !important; }
.offset-10 { margin-left: 87% !important; }
.offset-11 { margin-left: 93.5% !important; }
.offset-1:first-child { margin-left: 8.5% !important; }
.offset-2:first-child { margin-left: 17% !important; }
.offset-3:first-child { margin-left: 25.5% !important; }
.offset-4:first-child { margin-left: 34% !important; }
.offset-5:first-child { margin-left: 42.5% !important; }
.offset-6:first-child { margin-left: 51% !important; }
.offset-7:first-child { margin-left: 59.5% !important; }
.offset-8:first-child { margin-left: 68% !important; }
.offset-9:first-child { margin-left: 76.5% !important; }
.offset-10:first-child { margin-left: 85% !important; }
@media screen and (max-width: 720px) {
.row > .col {
width: 100%;
margin-left: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment