Last active
February 22, 2016 07:18
-
-
Save alpavlove/675cca955e89636a3770 to your computer and use it in GitHub Desktop.
vertical align
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="parent"> | |
<div class="child">asdasdasd</div> | |
<div class="vertical-align"></div> | |
</div> | |
*/ | |
.parent { | |
position: absolute; | |
top: 0; | |
left: 0; | |
display: block; | |
width: 100%; | |
height: 100%; | |
text-align: center; | |
white-space: normal; | |
word-wrap: normal; | |
} | |
.child { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.vertical-align { | |
display: inline-block; | |
vertical-align: middle; | |
height: 100%; | |
width: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment