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

Code 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
Luke Bellamy
3,592 Points

if footer is a tag (<footer>) then remove the '.' before it

Thank you. I somehow missed it. Have a wonderful day! Keith

Hi 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