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 trialAnthony Castrio
1,182 PointsQuestion 4: Footer link not responding to nested scss.
Question 4 of the Advanced Nesting quiz asks us to target the 'a' tag in the 'p' of a 'div' with class "footer".
Why doesn't the following Sass code make the footer link change to purple?
p { a { color: red; .footer & { color: purple; } } }
answered: https://teamtreehouse.com/forum/ampersand-postselector-help-please
Anthony Castrio
1,182 PointsWayne Priestley Yes, the DIV with class "footer". (Updated the question for clarity)
3 Answers
Wayne Priestley
19,579 PointsHi Anthony,
In that case, you need to include the div
too.
p {
a {
color: red;
div.footer & {
color: purple;
}
}
}
Anthony Castrio
1,182 PointsThank you Wayne!
Jeff Jacobson-Swartfager
15,419 PointsThis question was also answered previously.
Anthony Castrio
1,182 PointsThank you, that didn't come up in the previous question search. I'll add that link to the body of my question!
Eric Phy
1,938 PointsWhy do you have to include div?
Wayne Priestley
19,579 PointsWayne Priestley
19,579 PointsIs this the challenge that asks you to do something with the DIV of FOOTER?