<div class="container">
  <div class="item"></div>
</div>
.container {
  position: relative;
  height: 90vh;
  width: 90vw;
  border: 3px solid black;
  margin: auto;
}

.item {
  position: absolute;
  top: 50%;
  left: 10vw; right: 10vw;
  height: 50vh;
  margin-top: -25vh;
  background: teal;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.