<div class="center-me">
  I'm centered!
</div>
body, html {
  height: 100%;
  display: grid;
}
.center-me {
  margin: auto;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.

Packages

This Pen doesn't use any packages.