Flexbox for Centering Items Horizontally and Vertically in CSS


Use Flexbox to easily center items both horizontally and vertically within a container.

Source Code

.center-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments