Created
January 23, 2018 09:06
-
-
Save yann-yinn/8ad915d83ebda50d48077a6e318c1b4b to your computer and use it in GitHub Desktop.
Flex : center element vertically and horizontally
This file contains hidden or 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
<!-- | |
On the parent div : | |
display:flex | |
align-items: center; | |
justify-content: center; | |
--> | |
<div style="background: silver; height: 100vh; display:flex; align-items: center;justify-content: center;" class="container"> | |
<div style="background: yellow; height: 20vh">Center me please</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment