Design comparison
Solution retrospective
how can I center the card vertically?
Community feedback
- @vboechatPosted over 2 years ago
Beautiful! But you just forgot the card shadow.
1 - @kxnzxPosted over 2 years ago
Hello @Hassan-Wanas,
Try this:
body { display: grid; place-items: center; margin-top: 20%; }
Also add a max-width and padding on the card.
Hope this helps you further!
0@AnaghoPosted over 2 years ago@kxnzx You should try using flex-box. body { display: flex; justify-content: center; align-items: center; height: 100vh; }
Marked as helpful1@Hassan-WanasPosted over 2 years ago@kxnzx Thanks for your time.
but it does not work and I think there is no need for a display grid and place items.
It just moves to the center a little because of the margin-top.
but do you have any idea about why the live link is not showing the right design?
0@Hassan-WanasPosted over 2 years ago@Anagho yes, it works. thanks and I saw your code and will back to it again to learn more. I have one more question: why or how can I make the live link work correctly?
edit: I changed the hosting for my card and it appears now normally when I open the link here but not in the comparison.
0
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