Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive mobile-first layout using flexbox

bfc 160

@bfc0

Desktop design screenshot for the Social proof section coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Josh 1,070

@josh76543210

Posted

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 with padding-top:

@media (min-width: 900px) {
  main {
    padding-top: 8em;
  }
}

Then, replace the margin-top on the h1 tag with padding-top:

h1 {
  padding-top: 2.3em;
}

Finally, remove the margin-inline: 1em; on the h1 tag and reset margin to 0:

h1 {
  margin: 0;
}

The margins were what was causing the scrollbar to appear unnecessarily.

Hope that helps. Happy coding!

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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