Asked in job interview | How to center an object or Image using HTML and CSS flex | IT Rebels
Channel: IT Rebels
Date: 2022-11-21

**How to center an element horizontally and vertically**
Flexbox: center horizontally and vertically
Flexbox method
```
display: -webkit-flexbox;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    justify-content: center;
```