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

HTML How to Make a Website Debugging HTML and CSS Problems Use Developer Tools

How do I remove the white space at the top of the About page header?

Here's a snapshot of my work space: https://w.trhou.se/9y73fr0dht I ran the all the html and css files through both w3C Validators and they passed. About page: Is that white space above the header suppose to be there? How can I remove it? Thanks.

2 Answers

Hi Jonathan, there are couple thing to fix. First, viewport meta should be ”initial-scale” not ”initial-scale”, fix this for all your html files. And second, your main.css is missing rule for h3 which should be ”h3 { margin: 0 0 1em; }”.

This white margin comes there because header is floated left and it’s not cleared before h3 and h3 has predefined top-margin. Actually better way to fix this for good, would be setting ”float: left;” for wrapper, so the header would be always cleared and there will be no more problems with that in different situations. Setting h3 top-margin to 0 only solves the problem when h3 is the first non-floated element on page.

So, if you set h3 margins and don’t touch wrapper and change h3 to h4 in your html, you will see that problem is there again. Fixing the wrapper will be permanent solution.

#wrapper {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 5%;
  clear: both;
}

h3 {
  margin: 0 0 1em;
}
Sahil Prajapati
Sahil Prajapati
8,524 Points

Set margin-top of h3 under section element to 0.

        section h3{
           margin-top: 0;
        }