octavian-nita
8/9/2017 - 2:06 PM

The Best Way to Implement a “Wrapper” in CSS (?) (@see https://css-tricks.com/best-way-implement-wrapper-css/)

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 */
}