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 CSS Foundations Selectors Type, Class, and ID Selectors

Benjamin Jackowitz
Benjamin Jackowitz
1,315 Points

Stuck

assigned class="header" to the <h1 class="header"> in HTML. In CSS have

.header{background: darkblue;}

suggestions?

4 Answers

Hi Benjamin,

I believe this is what you're after.

Jeff

h1 {
  color: darkblue;
}

Jeff is right. If the header has been defined as a class in the html doc I think there would have to be a period before the h1: .h1 { color: darkblue; } If your are going to use the hex notation for color values you'll need to have a # prefix: #asdfas;

Hello Benjamin, What Track is this you stuck on? And what stage? It looks like you are assigning a background color to the header class.

Benjamin Jackowitz
Benjamin Jackowitz
1,315 Points

Thanks Rene. I believe that's what it's asking me to do. I am to select (in CSS stylesheet) the <h1>. I gave it <h1 class="header">asdfas</h1> in css i did the above. Any idea what I'm doing wrong here?

Thanks!