Responsive Web Design Certification Projects

CodePen handles the HTML portion differently. The code that you put into the editor is already in a boilerplate format. You can read more about it at this link.

I think the reason that you’re confused is because your code to CodePen looks like

<body>
  <main id="main">
    <body>
      ...
    </body>
  </main>
</body>

This is because CodePen already creates the

<html>
  <head>
  </head>
  <body>
   < !-- __This is where the html portion of your code goes__ -->
  </body>
</html>

So a simple solution to getting rid of the white space at the bottom would be changing your css rule!

body {
  padding: 0;
  margin: 0 0 0 0;
  font-family: "Courier New"
}

to

body {
  background-color: red;
  padding: 0;
  margin: 0;
  font-family: "Courier New"
}

That’ll let the red background cover the entire viewport! Also, as a fun little tid-bit, I’ve used the margin shorthand. Instead of saying:

margin: 0 0 0 0;

You can use:

margin: 0;

Read more about the margin shorthand here!
https://www.w3schools.com/cssref/pr_margin.asp

1 Like