<div class="parent">
  <div class="child">1</div>
  <div class="child">2</div>
</div>
.parent {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
  
/* --------- Non-flexbox related styles --------- */
.parent {
  height: 100vh;
}

.parent > div {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1%;
  padding: 10px 30px;
  font-size: 60px;
  line-height: 80px;
  color: #ffeedf;
  background-color: #eab768;
  border-radius: 10px;
  border: 10px solid #f5cc8b;
}

body {
  background-color: #282c35;
  font-family: Verdana;
  font-weight: 600;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.