Skip to content

Instantly share code, notes, and snippets.

@whitershade
Created February 8, 2016 21:56
Show Gist options
  • Save whitershade/2b46d34ede14249d32aa to your computer and use it in GitHub Desktop.
Save whitershade/2b46d34ede14249d32aa to your computer and use it in GitHub Desktop.
center position hack
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