<div class="center box">
  <h2>Center Me in Box</h2>
</div>
.center {
  display: flex;
  /* Default direction = row  */
  flex-direction: row;   
  
  /* Horizontal Centering */
  justify-content: center;
  
  /* Vertical Centering */
  align-items: center;     
}

body {
  font-family: 'Montserrat', sans-serif; 
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
h2 {
  /* text-align: center; */
  color: white; 
  font-size: 1.6em;
}
.box {
  height: 17em; 
  width: 17em;
  background: #2e6371;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.