<div class="wrapper">
    <div class="box"></div>
</div>
body {
  margin: 0;
  padding: 0;
}
.wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
}
.box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background-color: #333333;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.