Responsive Web Design Projects-Build a Survey Form

Hey, I just want to thank whoever looks at this in advance for helping me address this issue because I’ve been staring at it for the past couple hours trying to find a fix :man_facepalming:t4:

So, when doing these projects I usually copy and paste the instructions into the top of Codepen’s HTML editor before and then comment it out. When doing this I accidentally made an error where instead of using :<!-- --> tags I input .<!-- -->

However, this extra period before my comment tag is allowing the “margin: 0 ;” command that I input into my body element to function as intended:

Whenever, I take this period away it looks like this:

Below, I will copy and paste the URL for the project on Codepen since I think it’s easier to look at than inputting code blocks. But if whoever’s looking at this would prefer the code blocks format. Please let me know! Thanks again!

FreeCodeCamp Survey Form Codepen

I could not recreate that screenshot, it’s working fine for me.

What do you mean by that? Do you mean you couldn’t recreate the second screenshot where there is empty space using between the header and the webpage using my code ?

Yes, no errors for me. windows 10, chrome browser.

Wait, I didn’t see that at first, let me check

1 Like

Aye, thanks I appreciate it :slight_smile:

I don’t know why the ‘.’ at the start makes it function, but anyway I found the “problem”:

.container {
  width: 100%;
  margin: 3.125rem auto 0 auto;
}

Your div which contains the header, has the class container, and you have a top margin on that class. Remove it or make a new class if it’s used elsewhere.

.container {
  width: 100%;
  margin: 0 auto 0 auto;
}
1 Like

That did it. Thanks so much!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.