The quickest way to center anything in CSS.
To center a div both horizontally and vertically using CSS Grid, you only need two lines of CSS on the parent container.
```css
.container {
display: grid;
place-items: center;
min-height: 100vh;
}
```
This is much cleaner than the old flexbox or absolute positioning methods.
```css
.container {
display: grid;
place-items: center;
min-height: 100vh;
}
```
This is much cleaner than the old flexbox or absolute positioning methods.