<div class="parent">
  <div class="child">
    'm a block-level element with an unknown height, centered vertically within my parent.
  </div>
</div>
.parent {
  background: black;
  height: 300px;
  padding: 0 30px;
  position: relative;
}

.child {
  background: white;
  width: 200px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.