Design comparison
Solution retrospective
I don't understand how to position the background properly - either you set the height of body and html to 100% and get the unnecessary scrollbar, or have the lower image cut off.
Community feedback
- @josh76543210Posted about 1 year ago
Hi @bfc0,
Good job completing the challenge. Looks good!
Here is what you can do to fix the background and prevent the scrollbar from appearing:
First, set the body
min-height
to fill the entire veiwport:body { min-height: 100vh; }
Then, replace the
margin-top
on the main tag in the media-query withpadding-top
:@media (min-width: 900px) { main { padding-top: 8em; } }
Then, replace the
margin-top
on the h1 tag withpadding-top
:h1 { padding-top: 2.3em; }
Finally, remove the
margin-inline: 1em;
on the h1 tag and resetmargin
to 0:h1 { margin: 0; }
The margins were what was causing the scrollbar to appear unnecessarily.
Hope that helps. Happy coding!
Marked as helpful0
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