Created
May 18, 2014 14:08
-
-
Save brandonpittman/573d2478e4a00535e6fc to your computer and use it in GitHub Desktop.
Vertical center centering with a table
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
But if you’re using a table for this purpose (and not to display tabular-data), instead you should use another type of element (div, for example), and set its display property to table to mimick a the table behavior. | |
<style> | |
.vertical-outer { | |
display: table; | |
height: 10em | |
} | |
.vertical-inner { | |
display: table-cell; | |
vertical-align: middle | |
} | |
</style> | |
<div class="vertical-outer"> | |
<div class="vertical-inner"> | |
<p>I’m so centered it’s not even funny.</p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment