Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Styling Web Pages and Navigation Build Navigation with Unordered Lists

Charles Rich
Charles Rich
7,454 Points

Unable to remove white space above 1st level headline

I am working through the "Build Navigation with Unordered Lists: video. I have not been able to remove the white space above the 1st level headline. Any ideas?

header {

  float: left;

  margin: 0 0 30px 0;

  padding: 5px 0 0 0;

  width: 100%;
}

3 Answers

Hi Charles,

I think this isn't a proper fix for the problem and you have something else going on.

Your header css in your question is matching what Nick has in the project.

Did you by chance add some extra content to the page that differed from the video? Did you add a paragraph or heading above the gallery images?

Charles Rich
Charles Rich
7,454 Points

I had moved on since my "-20px" seemed to fix the problem. After your comment I went back through everything line by line. Very time consuming. I believe I found the problem. I misspelled "gallery" in the PORTFOLIO section. Once I fixed the spelling, I reset the margin in the header section to "margin: 0 0 30px 0;" and everything worked. Thanks for the encouragement to keep looking.

#gallery {

    margin: 0;

    padding: 0;

    list-style: none;
}
Charles Rich
Charles Rich
7,454 Points

I changed the value for the top spacing from "0" to "-20px" and it works now. The code now looks like this:

header {

  float: left;

  margin: -20px 0 30px 0;

  padding: 5px 0 0 0;

  width: 100%;
}

that should work, try with placing this code at the end of css code, something might overrules it..

Charles Rich
Charles Rich
7,454 Points

I tried that in both the main.css and normalize.css files and it did not work. Good idea