DEV Community
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%);
}
For further actions, you may consider blocking this person and/or reporting abuse
Read next
CSS Flexbox: Creating a Sticky Sidebar
Tailwine -
Best Practices for Writing CSS – Clean, Scalable, and Maintainable Code
Ridoy Hasan -
How to Create a Navigation Bar Using HTML and CSS
Bitlearners -
6 Cool Things You Can Do With Regular HTML
adarsh -
Top comments (0)