Flexbox used to align the main div vertically and horizontally.
Design comparison
Solution retrospective
I managed to make the project identical to the design, using beginner properties, and Flexbox to align the main div vertically and horizontally. I did this project once, it wasn't identical so I'm redoing it, I'm happy because I managed to fix the content well, improve the design in code form.
What challenges did you encounter, and how did you overcome them?At first it was difficult to center the main div vertically, to center it horizontally I used margin: auto, but after studying more and getting to know Flexbox, I learned how to center it vertically and horizontally in a very simple way.
Community feedback
- @riccardobelliniPosted 2 months ago
I would avoid using margins for the card component and center it both horizontally and vertically using flexbox:
body { display: flex; align-items: center; justify-content: center; }
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