Usando Display Grid 😎
Forma 1
div {
display: grid;
justify-content: center;
align-items: center;
}
Forma 2
div {
display: grid;
place-content: center;
}
Usando display Flex 🥳
div {
display: flex;
justify-content: center;
align-items: center;
}
Usando position absolute 👀
div {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Top comments (0)