Design comparison
Solution retrospective
My code is as follows for the body:
body{ background-color: hsl(212, 45%, 89%) ; min-height: 100vh; display: grid; place-content: center;
It seems to be properly centered with Live Server but it displays differently with the Github link.
Community feedback
- @kkhwjnrkPosted over 1 year ago
To properly center the content, you can move the properties from the
body
element to themain
element and adjust themin-height: 90vh;
. Additionally, you may need to reduce the top margin on the.attribution
body { background-color: hsl(212, 45%, 89%); } main { min-height: 90vh; display: grid; place-items: center; }
Marked as helpful1 - @CNash23Posted over 1 year ago
At least the reporter found no issues. The first time I did this challenge I think it was centered better when I used margins. So I wonder what the issue could be. This is the author of this challenge project CNash23.
0@atif-devPosted over 1 year ago@CNash23 Probably, you didn't change the code in GitHub repository... In body selector replace
place-items: center;
withplace-content: center;
and in.attribution
selector removemargin-top: 6.25rem;
After doing changes card will be centered.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