CSS Flexbox Centering Playground
LayoutFlexbox centers things with two properties on the parent. justify-content works along the main axis and align-items works across it. Set both to center and the child sits in the middle.
flexbox browser support
Widely availableSince 201597% of people can use this
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
Safe to use without fallbacks.