Andrew Allen• 10
@AdditionAddict
Posted
To center a child element inside a div:
div {
display: flex;
justify-content: center; // along primary axis (default x)
align-items: center; // along secondary axis (default y)
}
0
Llevo poco más de una semana aprendiendo HTML y CSS. No pude centrar el div, por mas que use grid, flex, y probé varias opciones más para intentar hacerlo. Esto fue lo mejor que pude hacer por el momento. Espero seguir aprendiendo. Y poder mejorarlo.
@AdditionAddict
Posted
To center a child element inside a div:
div {
display: flex;
justify-content: center; // along primary axis (default x)
align-items: center; // along secondary axis (default y)
}
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord