Center an Element Horizontally and Vertically using Flexbox

InstructorAli Spittel

Share this video with your friends

Send Tweet

We have a parent HTML element that takes up the height and width of the page. We will make that parent element into a flex container, and then vertically center its child element using align-items: center;. Finally, we'll use justify-content: center; to horizontally center the element.