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 Customizing Colors and Fonts Use Color in CSS

Alonso Sainz
Alonso Sainz
2,615 Points

When I add color to the header background it only uses the color I applied to all the document background

I added a grey color to all the document bakground (*{background-color:#e6e6e6;}) but after that when I apply a darker grey to the header (header{bakground-color:#b3b3b3 }) it doesnt apply it just uses the overall background color. How can I change it with out afecting the overall color?>

Oscar Vargas Sanchez
Oscar Vargas Sanchez
1,382 Points

Try adding a class or an id to the header that would make it easier adding styles to your header.

4 Answers

Birte Müller
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Birte Müller
Front End Web Development Techdegree Graduate 16,026 Points

Is this an exact copy of your code? Because here the background-color for your header is lacking a c and the semicolon is missing. After correcting the typo it should work. header{background-color:#b3b3b3; }

If you are defining the header before the / above the *{ ... } selector you may be overwriting it. Make sure you are defining header{ } below / after the * { } definition.

Otherwise like Birte said above check your spelling for you properties within header { ... } definition.

Alonso Sainz
Alonso Sainz
2,615 Points

Sorry it is a typo. And I did define *{...} before the header

Alonso Sainz
Alonso Sainz
2,615 Points

A friend helped me and I aplied the background color to the body insted of the *. Thanks for helping me a bit