Skip to content

Instantly share code, notes, and snippets.

@jorgechavz
Created July 4, 2015 01:30
Show Gist options
  • Save jorgechavz/a2ccc0464b3f18e1601a to your computer and use it in GitHub Desktop.
Save jorgechavz/a2ccc0464b3f18e1601a to your computer and use it in GitHub Desktop.
Center Verticaly
<style>
/* Define the height parent */
#parent{
height: 500px;
}
.astable{
width: 100%;
height: 100%;
display: table;
.ascell{
width: 100%;
height:100%;
display:table-cell;
vertical-align:middle;
text-align:center;
}
</style>
<div id="parent">
<div class="astable">
<div class="ascell">
<!-- YOUR CONTENT -->
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment