Created
April 16, 2014 08:56
-
-
Save ayozebarrera/10836253 to your computer and use it in GitHub Desktop.
List vertical align
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
/*This works because two inline-block elements will vertically align with each other. | |
The :before rule creates an inline-block element that is the same height as its parent, | |
which the variable height <span> can vertically align with.*/ | |
ul li span { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
ul li:before{ | |
content: ''; | |
display: inline-block; | |
vertical-align: middle; | |
height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment