Layout Using Flexbox

Solution retrospective
I am proud of the way I used flexbox
What challenges did you encounter, and how did you overcome them?Had some trouble centering the white layout
What specific areas of your project would you like help with?I would like help centering the layout.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @KuvashneeNaidoo
Hi @JF451
Excellent work creating this 3 column preview card! Your HTML is semantically correct after I tested it using The W3C Markup Validation Service 👏⭐👏
To help you to center the layout, I would encourage you to use
height: 100vh;
in the body:body { display: flex; justify-content: center; align-items: center; height: 100vh; // Add this in }
With this implementation, the body stretches to fill the full height of the screen, which allows
align-items: center
andjustify-content: center
to position the content right in the middle of the screen. So overall,height: 100vh;
creates enough vertical space for centering to work.I hope this helps 🙏
Happy coding :) 🚀🚀🚀
- @4rch1tT
You can use display: grid, place-items: center and height: 100vh this will center the div. Hope this helps.
Join 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