Design comparison
Solution retrospective
hi everyone!
here is my second coding challenge, it was much easier than the previous one for me as it pretty much followed the same model, the only issue i faced so far was margin: 0 auto;
not working when applied to the body but it worked when i used it on my container div.
the only feedback i need so far is any advice on why margin: 0 auto;
didn't work in my code, but i am of course open to any other suggestion that would allow me to improve my code if you see fit! :)
Community feedback
- @Saran-73Posted almost 3 years ago
Hi 👋 congratulations on finishing this project.It seems like u didn't enclose entire container in main tag and u used main for each card ,just replace div to <main> tag for u r container and replace main with <section> tag for each card to resolve accessibility issue.I am not sure about margin I may be wrong but think about in this way we set margin to an element for which we need to adjust the margin not to its parent .Here body is the parent and the container is the child so using margin property for the desired element i.e child works .
Marked as helpful1@SprintStarDVPosted almost 3 years ago@Saran-73 thank you for your advice & your explanation on my
margin: 0 auto;
issue!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