Created
February 8, 2016 21:56
-
-
Save whitershade/2b46d34ede14249d32aa to your computer and use it in GitHub Desktop.
center position hack
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
HTML | |
<div class="table"> | |
<div class="table-row"> | |
<div class="table-cell"> | |
</div> | |
</div> | |
</div> | |
CSS | |
.table{ | |
display: table; | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} | |
.table-row{ | |
display: table-row; | |
} | |
.table-cell{ | |
display: table-cell; | |
text-align: center; | |
vertical-align: middle; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment