Skip to content

Instantly share code, notes, and snippets.

@erbmicha
Created March 1, 2013 16:13
Show Gist options
  • Save erbmicha/5065682 to your computer and use it in GitHub Desktop.
Save erbmicha/5065682 to your computer and use it in GitHub Desktop.
CSS technique for utilizing calc to center content inside a container instead of using 'margin:0 auto' on all elements inside the container.
.section {
width: 700px;
padding: 1em calc(50% - 350px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment