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


Griffith Poindexter
Griffith Poindexter
5,069 Points

I need help with my header!!

When I try and style my header on css, the coloring doesn't take up the full width of the webpage. It takes about 95% of it, and even when I put width: 100% it doesn't work. How do you get your header to fill up the top of your webpage? Thanks.

3 Answers

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Hi Griffith, Without seeing all the code, I'm going to guess that there may be some default browser styling happening. You can try adding 'normalize.css' to you page. You could also clear out the margins, borders and padding on the <html> and/or <body> elements, but that may have undesired effects on the entire page (personally, I don't like doing that... normalize.css usually works.

A third possible course of action is to make the header element bigger than 100% (eg. width: 120%).

Hope you find something that works right for you.

Keep coding! Jason :)

Manuel Quintanilla
Manuel Quintanilla
3,083 Points

You may have to take the margins from the body

body {
margin: 0;
border: 0;
padding: 0