Skip to content

Instantly share code, notes, and snippets.

@alpavlove
Last active February 22, 2016 07:18
Show Gist options
  • Save alpavlove/675cca955e89636a3770 to your computer and use it in GitHub Desktop.
Save alpavlove/675cca955e89636a3770 to your computer and use it in GitHub Desktop.
vertical align
/*
<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