WeCodeAcademy

Center a div horizontally and vertically

Use flexbox on the parent: justify-content and align-items both set to center.

Examplehtml
Open in editor »

More CSS recipes