Created
June 13, 2013 19:53
-
-
Save jonhkr/5776788 to your computer and use it in GitHub Desktop.
Vertical aligning inline elements inside container
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
<div class='container'> | |
<span>Some text</span> | |
</div> |
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
.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