Skip to content

Instantly share code, notes, and snippets.

@jonhkr
Created June 13, 2013 19:53
Show Gist options
  • Save jonhkr/5776788 to your computer and use it in GitHub Desktop.
Save jonhkr/5776788 to your computer and use it in GitHub Desktop.
Vertical aligning inline elements inside container
<div class='container'>
<span>Some text</span>
</div>
.container {
height: 400px;
}
.container span:before {
content: '.';
line-height: 400px;
visibility: hidden;
}
.container span {
vertical-align: middle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment