Skip to content

Instantly share code, notes, and snippets.

@octavian-nita
Created August 9, 2017 14:06
Show Gist options
  • Save octavian-nita/efbb486c5f5ff250131cda1c985e19d7 to your computer and use it in GitHub Desktop.
Save octavian-nita/efbb486c5f5ff250131cda1c985e19d7 to your computer and use it in GitHub Desktop.
The Best Way to Implement a “Wrapper” in CSS (?) (@see https://css-tricks.com/best-way-implement-wrapper-css/)
/**
* See https://css-tricks.com/best-way-implement-wrapper-css/
*
* 1. Centers the content. Yes, it's a bit opinionated.
* 2. See the "width vs max-width" section
* 3. See the "Additional Padding" section
*/
.wrapper {
margin-right: auto; /* 1 */
margin-left: auto; /* 1 */
max-width: 960px; /* 2 */
padding-right: 10px; /* 3 */
padding-left: 10px; /* 3 */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment