Skip to content

Instantly share code, notes, and snippets.

@leuchtetgruen
Created August 1, 2013 08:30
Show Gist options
  • Save leuchtetgruen/6129536 to your computer and use it in GitHub Desktop.
Save leuchtetgruen/6129536 to your computer and use it in GitHub Desktop.
Centering elements with known heights and widths
#centered {
position: fixed;
top: 50%;
height: 100px;
margin-top: -50px;
left: 50%;
width: 400px;
margin-left: -200px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment