Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
Created November 1, 2012 20:23
Show Gist options
  • Save NapoleonWils0n/3996237 to your computer and use it in GitHub Desktop.
Save NapoleonWils0n/3996237 to your computer and use it in GitHub Desktop.
css: center div negative margins
div { position: absolute; left: 50%; width: 500px; margin-left: -250px; /*half the width of the div*/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment