How to Align Text Vertically Center in a DIV Using CSS

And horizontally, but everyone already know how to do that…

Grid + place-items

The solution is to use grid with place-items! place-items is the shorthand for writing both align-items and justify-items. It will also work if you use the latter. Learn more in-depth in the second section below.