<body>
  <div class="main">
    <div class="child"></div>
  </div>
</body>
.main {
  width: 100%;
  height: 100vh;
  background: #f88;
  display: flex;
  align-items: center;
  justify-content: center;
}
.child {
  width: 50%;
  height: 150px;
  background: #cecece
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.