Created
January 15, 2016 11:22
-
-
Save emersion/dbed407b5561cb5df258 to your computer and use it in GitHub Desktop.
Vertical align class
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
| <div class="valign" style="height: 500px;"> | |
| <div> | |
| Hi!<br> | |
| My name is... JOHN CENA!!1 | |
| </div> | |
| </div> |
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
| .valign { | |
| font-size: 0; | |
| } | |
| .valign::before { | |
| content: " "; | |
| display: inline-block; | |
| vertical-align: middle; | |
| height: 100%; | |
| width: 0; | |
| } | |
| .valign > * { | |
| display: inline-block; | |
| vertical-align: middle; | |
| font-size: normal; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment