Created
June 6, 2014 01:30
-
-
Save denzildoyle/1b0f27c5249bc21fb7f6 to your computer and use it in GitHub Desktop.
Vertical align anything with out the need to define its height. With only 5 lines of code.
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
position: relative; | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks good to me. Works in all modern browsers.