<div class="container">
  <div class="item"></div>
</div>
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

div.container {
  width: 600px;
  max-width: 100%;
  height: 600px;
  max-height: 100vh;
  background-color: #A16FB3;
  border: 2px solid black;
}

.item {
  width: 100px;
  height: 100px;
  background-color: #F7964A;
  border-radius: 5px;
  border: 2px solid black;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.