Social Media Links Challenge

Solution retrospective
Centering the card vertically proves to be challenging even when using the display:flex, i couldn't use it here because it just messed up my entire code when i tried so I had to eyeball it.
What specific areas of your project would you like help with?Centering it. I'm never able to make it work.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@djlaw90
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container >> great resource for centering a div with flexbox, both horizontally and vertically. I basically never do anything else now.
- @MarziaJalili
Nicely done!
Here's the answer from the conqueror:
✅ For centering the card make sure the body element have only one child element.
You can achieve this by wrapping everything inside the main element as follows:
<body> <main> <!-- All elements nested here... --> </main> </body>
✅ Now apply the following styles to the body selector in CSS:
display: grid; place-items: center; min-height: 100vh;
This will perfectly center the card across all devices.
😎😎😎
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