Created
January 4, 2016 07:55
-
-
Save floster/220046da18650bae9243 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 */ | |
.d-flex-vertical { | |
/* Tell flexbox to start vertically from the center */ | |
align-items:center; | |
display:flex; | |
/* I'm also aligning it horizontally */ | |
justify-content:center; | |
} | |
/* all the child element needs is to be a flex item */ | |
.d-flex-vertical > div { | |
display:flex; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment