Last active
June 15, 2018 06:44
-
-
Save sktwentysix/004889b4d5302eee28f81a39e7b3bbea to your computer and use it in GitHub Desktop.
CSS Flex Perfect Center
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
/* A basic example of how to center an element both verticallty and horizontally on a page or within a container */ | |
div { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
height: 100vh; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment