@Kl3va
Posted
display: flex Justify content: center //aligns items along its main axis(horizontally) Align items: center. // aligns items along its cross axis (vertically). By default display set to flex keeps items in a row form.
i still don´t know what is the right way to center a div horizontally and vertically... if anyone can help with that it would be very appreciated.
@Kl3va
Posted
display: flex Justify content: center //aligns items along its main axis(horizontally) Align items: center. // aligns items along its cross axis (vertically). By default display set to flex keeps items in a row form.
@moheb2000
Posted
Good work 🌸🌸🌸
If you want to center a component with flexbox you can use this:
.your_div {
display: flex;
justify-content: center;
align-items: center;
}
and the parent element for your div must have height: 100%;
Some other suggestions for achieving a better work:
I hope my advice help you. Keep going! 🌸🌸🌸
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