DEV Community

Discussion on: Centering vertically and horizontally with CSS

Collapse
 
dalcio profile image
Dalcio • Edited

Who place-items show. I was looking for this rule dude

div {
    height: 100vh;
    display: flex;
    place-items: center;
    place-content: center;
}
Enter fullscreen mode Exit fullscreen mode

Note flex and grid containers must have a height to be possible center the elements vertical