Last active
February 22, 2020 11:41
-
-
Save HarryAdney/629351ebfeb58d1d7d115ab6ef621f74 to your computer and use it in GitHub Desktop.
Vertical align with flex
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
Vertical align with flex | |
***html*** | |
parent { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
height: 100vh; | |
width: 100wh; | |
} | |
.child { | |
width: 100px; | |
height: 100px; | |
background-color: #20126f; | |
} | |
***css*** | |
<div class="parent"> | |
<div class="child"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment