<div class="object-wrapper">
  <!-- Place any object -->
  <div class="object-div">
    <div class="object">
      <h2>Hi, I am centered aligned!</h2>
    </div>
  </div>
</div>
.object-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.object-div {
  max-width: 420px;
  width: 100%;
}

.object {
  background-color: aqua;
  padding: 20px;
  display: inline-block;
  width: 100%;
  text-align: center;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.