
Solution retrospective
Centring the card on the page using flexbox
What challenges did you encounter, and how did you overcome them?- Centring the card
- Adding padding, margin and other things
- HTML structure
Please log in to post a comment
Log in with GitHubCommunity feedback
- @matbac85
Hey there! Just wanted to share a tip with you. If you're looking to center an element both vertically and horizontally, you can also use grids.
body { height: 100vh; display: grid; place-content: center; }
You've done a great job with your component! However, I noticed that it's a bit taller compared to the model. I think there's too much white space below your text (body). You can try reducing your margin-bottom from 40px to 24px. That should do the trick! Let me know how it goes.
- @danilscodes
Hi Kamran, I'm just starting out with front-end, but you seem like you've got HTML & CSS down already! Your solution looks great! I don't really have any feedback for you, just a question: why did you use rem for font size instead of px?
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