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

space above header

Hi, i am in the process of styling my contact page and I can't figure out why when i add any content to the section part of the contact page i get a white space above the header.... delete the section and it goes away.. my about page hass exactly the same code with 1 section and it works no problem.

any tips?

7 Answers

Be sure your section div comes after the heading closing tag

If that doesn't work you'll have to post your code so we can see what's going on

You say the contact page has the exact same layout of the about page except the about page works fine? I'd say importing the css from the about page instead of copying and pasting the same code in another css file could help. But I can't really say anything until I see code.

If you're working on "How to Make a Website" then you probably have a float clearing problem. If the first thing that you add in your section has a top margin then it will produce a corresponding gap above your header.

To fix this you should clear the floated header in your wrapper element.

#wrapper {
clear: both;
}

Add the clear property to the already existing wrapper rule.

If you're working on something else, then post code or link to a live preview if you can.

ok the clear:both worked. :) not sure how to do a live preview?

Glad you got it working. No need to do the live preview. I had only requested it if you were working on something else.

What I meant though was that you could give us the url of your project if you had it live somewhere. Either on workspaces or if you uploaded it to some web hosting. Then we would be able to look at it.

oh ok :) thanks for your help :)

oh ok :) thanks for your help :)