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 trialkeithhome
19,797 PointsCode Challenge Number 4
I am stuck with this challenge and could use some help. I have tried the following options but neither one works. Any help will be appreciated. Keith
.footer { a { & { color: purple; } } }
.footer { p { a { & { color: purple; } } } }
3 Answers
Luke Bellamy
3,592 Pointsif footer is a tag (<footer>) then remove the '.' before it
keithhome
19,797 PointsThank you. I somehow missed it. Have a wonderful day! Keith
Jason Anello
Courses Plus Student 94,610 PointsHi Keith,
"footer" is a class so you do need to keep the dot.
In the code that you have above you're not taking advantage of the nesting and the post selector &
The challenge doesn't want you to write a new rule with .footer
as the parent.
You already have a p a
selector set up.
p {
a {
}
}
Inside the a
rule is where you can put the exception for links within .footer
p {
a {
div.footer & {
color:purple;
}
}
}
&
in this context represents p a
so by putting it after div.footer
the final compiled selector would be div.footer p a