Problem Statement
How would you center a div both horizontally and vertically using Flexbox?
Explanation
You set the parent container as `display: flex`, then `justify-content: center` (horizontal centering on main axis) and `align-items: center` (vertical on cross axis). If the container is full height, this centers the child. Example:
```css
.parent { display: flex; justify-content: center; align-items: center; height: 100vh; }
.child { /* content */ }
```
Code Solution
SolutionRead Only
.parent { display:flex; justify-content:center; align-items:center; height:100vh; }