<div class="parent">
  <div class="child">
  </div>
</div>
.child {
  background-color: hotpink;
  height: 200px;
  width: 200px;
}

.parent {
  display: flex;
  align-items: center;
  justify-content: center;
}

body, html, .parent {
  height: 100%;
  width: 100%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.