---
# System prepended metadata

title: vertically and horizontally center use flex

---

# vertically and horizontally center use flex

Q: why use  flex?
Ans : to avoid float use flex.

Q :  vertically div ke center main item ki property flex main?
Ans :  align-item: center

Q :  horizontally div ke center main item ki property flex main?
Ans :  justify-content: center