Skip to content

Instantly share code, notes, and snippets.

@minusfive
Created May 5, 2014 17:22
Show Gist options
  • Save minusfive/d597ece7495c51cc254c to your computer and use it in GitHub Desktop.
Save minusfive/d597ece7495c51cc254c to your computer and use it in GitHub Desktop.
Vertical centering
#container{
position: relative; // Or fixed, or absolute
}
#centered-element{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 600px;
height: 600px;
margin: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment