Created
April 18, 2019 09:00
-
-
Save danilowoz/2f2d05b211c444de69a4b49b66671545 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
.container { | |
display: flex; | |
flex-flow: column wrap; | |
align-content: space-between; | |
/* Your container needs a fixed height, and it | |
* needs to be taller than your tallest column. */ | |
height: 600px; | |
} | |
.item { | |
width: 32%; | |
margin-bottom: 2%; /* Optional */ | |
} | |
/* Re-order items into 3 rows */ | |
.item:nth-child(3n+1) { order: 1; } | |
.item:nth-child(3n+2) { order: 2; } | |
.item:nth-child(3n) { order: 3; } | |
/* Force new columns */ | |
.container::before, | |
.container::after { | |
content: ""; | |
flex-basis: 100%; | |
width: 0; | |
order: 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment