<span>
  I'm centered!
</span>
body, html {
  height: 100%;
  display: grid;
}
span {
  margin: auto;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.