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 How to Make a Website Customizing Colors and Fonts Use Classes in CSS

Why are there two "a" selector bits of css? There is the one at the top and one after #logo.

I thought I could combine them, so I put the color declaration inside the top "a" area, but it didn't change the color. It only changed the color when I added that second "a" area under #logo.

3 Answers

Brandon Barrette
Brandon Barrette
20,485 Points

Without code, I'm not quite sure what you're asking, but I'll take a guess. Please correct me if I'm wrong.

So in CSS, this would mean:

/* all anchor tags on page */
a {
   color: purple;
}

/* only anchor tags INSIDE the element with ID = logo */
#logo a {
   color: red;
}

Thanks for the quick response! I think it was actually my fault, I had forgotten the hash sign for a color value. Whoops.

Ryne Smith
Ryne Smith
1,297 Points

I was still wondering why there are two "a" selectors still. Why did he not just put all of the declarations in one rule instead of making two?