Skip to content

Instantly share code, notes, and snippets.

@evitolins
Created June 18, 2017 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evitolins/ab45f2220186376c80d1387be40d912c to your computer and use it in GitHub Desktop.
Save evitolins/ab45f2220186376c80d1387be40d912c to your computer and use it in GitHub Desktop.
A simple responsive grid using flexbox
.grid .cell {
position: relative;
margin: 1rem 1rem 2rem;
}
@media screen and (min-width: 600px) {
.grid {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.grid .cell {
width: calc(50% - 2rem);
}
}
@media screen and (min-width: 1000px) {
.grid .cell {
width: calc(33.3333% - 2rem);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment