Last active
August 11, 2017 22:30
-
-
Save lucasvalhos/8947e4ca6aa4a9097e074dea3e88f346 to your computer and use it in GitHub Desktop.
align div vertically middle, center, middle
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
/* fallback for non-Flexbox browsers */ | |
display: inline-block; | |
/* Flexbox browsers */ | |
display: -webkit-inline-box; | |
display: -moz-inline-box; | |
display: -ms-inline-flexbox; | |
display: -webkit-inline-flex; | |
display: inline-flex; | |
/* vertical centering for legacy, horizontal centering for modern */ | |
-webkit-box-pack: center; | |
-moz-box-pack: center; | |
-ms-flex-pack: center; | |
-webkit-justify-content: center; | |
justify-content: center; | |
/* modern Flexbox only */ | |
-ms-flex-align: center; | |
-webkit-align-items: center; | |
align-items: center; | |
/* legacy Flexbox only */ | |
-webkit-box-orient: vertical; | |
-moz-box-orient: vertical; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment