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 trialAllison Chefec
2,781 PointsWhy 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
20,485 PointsWithout 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;
}
Allison Chefec
2,781 PointsThanks for the quick response! I think it was actually my fault, I had forgotten the hash sign for a color value. Whoops.
Ryne Smith
1,297 PointsI 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?