<div class="div1">
  <button>button1</button>
</div>

<div class="div2">
  <button>button2</button>
</div>
div {
  margin-bottom: 20px;
  border: 1px solid red;
}

.div1 {
  text-align: center;
}

.div2 button {
  display: block;
  margin: auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.