Created
January 13, 2014 11:21
-
-
Save davidthingsaker/8398666 to your computer and use it in GitHub Desktop.
To vertically align multiple lines of text including a fix for IE7
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
.textBox { | |
position: relative; | |
height: 100%; | |
} | |
.inner { | |
position: absolute; | |
display: table; | |
width: 100%; | |
height: 100%; | |
top: 0; left: 0; | |
.element { | |
display: table-cell; | |
vertical-align: middle; | |
html.ie7 & { | |
position: absolute; | |
width: 100%; | |
top: 50%; | |
left: 0; | |
} | |
span { | |
display: inline-block; | |
html.ie7 & { | |
position: relative; | |
height: 100%; | |
top: -50%; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment