<div class="container">
  <div class="element">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Natus, veniam, optio, eligendi repellat ducimus doloribus soluta debitis autem nostrum illum saepe in quasi eum dolorem sit dolores molestiae consectetur repellendus!
  </div>
</div>
body {
  background-color: #F5F5F5;
  color: #555;
  font-size: 1.1em;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

hr {
  margin: 50px 0;
}

.container {
  margin: 40px auto;
  max-width: 500px;
  background-color: purple;
}

.element {
  background-color: white;
  font-size: 1em;
  /* change the font size to see how the margins adjust */

  margin: auto;
  padding: 1.5em;
  /* 1em margin on each side */
  /* 1em margin on each side */

  width: calc(100% - 2em);
  /* 1em margin on each side */
}