Created
April 16, 2019 07:01
-
-
Save yordanzhelevdev/768d5fc612f7321e9626316508064b51 to your computer and use it in GitHub Desktop.
Unknown number items spacing distribution with flexbox
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
.items { | |
display: flex; | |
flex-wrap: wrap; | |
width: 1000px; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
margin: -3% 0 0 -3%; | |
} | |
.item { | |
width: 200px; | |
height: 100px; | |
background: teal; | |
margin: 3% 0 0 3%; | |
} |
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
<div class="items"> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment