Edit on
<main>
  <div class="center">
    I'm a block level element and am centered.
  </div>
</main>
body {
  background: #f06d06;
}

main {
  background: white;
  margin: 20px 0;
  padding: 10px;
}

.center {
  margin: 0 auto;
  width: 200px;
  background: black;
  padding: 20px;
  color: white;
}
Rerun