Last active
February 7, 2018 22:19
-
-
Save joshfitzgerald/974a5de684697efa07336dbafdeceafe to your computer and use it in GitHub Desktop.
Center vertically and horizontally using CSS 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
.middle { | |
display: flex; | |
flex-direction: row; /* sets main axis as horizontal */ | |
justify-content: center; /* affects main axis - horizontal here */ | |
align-items: center; /* affects cross axis - vertical here */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment