Last active
December 10, 2015 01:34
-
-
Save blasten/fbf1b38bd00e2ad2d34d to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style> | |
.grid { | |
display: flex; | |
flex-direction: row; | |
flex-wrap: wrap; | |
display: -webkit-flex; | |
-webkit-flex-direction: row; | |
-webkit-flex-wrap: wrap; | |
} | |
.grid div { | |
height: 100px; | |
margin: 10px; | |
background: red; | |
/* 3 columns*/ | |
width: calc((100% - 60px) / 3); | |
} | |
@media (max-width: 800px) { | |
/* 2 columns*/ | |
.grid div { | |
width: calc((100% - 40px) / 2); | |
} | |
} | |
@media (max-width: 500px) { | |
/* 1 column*/ | |
.grid div { | |
width: 100%; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="grid"> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment