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 Sass Basics (retired) Getting Started with Sass Advanced Nesting

Question 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

Wayne Priestley
Wayne Priestley
19,579 Points

Is this the challenge that asks you to do something with the DIV of FOOTER?

Wayne Priestley Yes, the DIV with class "footer". (Updated the question for clarity)

3 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Anthony,

In that case, you need to include the div too.

p { 
   a { 
       color: red;

       div.footer & { 
       color: purple;
   }
}
} 

Thank you Wayne!

Thank you, that didn't come up in the previous question search. I'll add that link to the body of my question!

Eric Phy
Eric Phy
1,938 Points

Why do you have to include div?