Design comparison
Solution retrospective
I am proud of building my first on frontend mentor. It is a way of making sure that you understand HTML & CSS.
What challenges did you encounter, and how did you overcome them?I struggled a lot with centering the container but still I don't think I did the right thing but I tried my best to center it.
What specific areas of your project would you like help with?Hey community, I am kind of lost when it comes to make it responsive, because it seems I can't seem to get the screen sizes right.
Community feedback
- @manishsinghrajPosted 6 months ago
You did great!. About centering the container you can always try with flex.
The object you want to center. You need to make it's parent element as flex. In your case (according to the your code), body should be made to flex.
It's better to have another div element before the card container and after body. As we don't want to make body as flex( not good practice).
display: flex; justify-content: center; align-items: center; min-height: 100vh;
All you need to do is make it flex.
In order to center it horizontally use justify-content : center.
In order to make it vertically aligned use align-items : center.
And the current min view height should take up to 100vh.
This is the usual pattern one can use to center it.
Marked as helpful1
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