Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

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
MOD
Jason Anders
Treehouse Moderator 145,704 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
}