Andi Gashi• 350
@Andigashi1
Posted
The best way to center elements is to give flex or grid to the body. I usually use flex:
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh
}
1
Gabriel Garcia• 50
@garbiru
Posted
@Andigashi1 Here's a cool way with grid as well.
body{
min-height: 100vh;
display: grid;
place-items: center;
}
0