Design comparison
Solution retrospective
Day 1[reboot] Hello any advice on what to improve? Also I have difficulties in centering div tags
Thank you!
Community feedback
- @SpyrosAlivPosted over 1 year ago
Great solution!
As for centering an element inside another element, flexbox is the way to go. By setting the display of the parent element to "flex", you can set the following attributes to the child "self-align: center; justify-self: center;". This will center the element both vertically and horizontally inside the parent element.
Marked as helpful1 - @amrajatPosted over 1 year ago
Congratulations on completing the challenge. There are a couple of hacks for centering a div horizontally and vertically. One easy hack is flex ->
set display: flex, align-items: center, justify-content: center
to the parent element. Hope this helps :)Marked as helpful0 - @LahcenalllPosted over 1 year ago
Hello,
I applaud you for your efforts and for taking this challenge. I've noticed that you've had trouble centering the card. I've suffered from that too, lol, so here's how to easily center it using flex box.
- make sure the body has a width & height of 100percent, and use the following :
display: flex; align-items: center; justify-content: center;
Happy coding.
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
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