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

Aaron Brewer
Aaron Brewer
7,939 Points

Sass Basics - Getting Started with Sass - Advanced Nesting - Challenge 4 of 4

Alright, I believe something may be up with this challenge. Basically the Advanced Nesting Challange, last problem is asking me the following:

We want to add an exception for a tags that are are in the div with a class of '.footer': those links should be purple. Use the post-selector ampersand to achieve this.

This is my SCSS code:

p {
    a {
    color: red;
        .footer & {
           color: purple;
         }
  }
  > a {
    color: blue;
        &:hover {
        opacity: 0.5;
    }
  }
}

I have tested the page, and have seen the link turn purple and have even compiled it in my Prepos Sass compiler... It does exactly what is intended and asked, but even when switching my code around to a direct child of the a tag, it doesn't mark it as completed.

Am I doing something wrong here? Thank you so much! Aaron

7 Answers

Tom Bedford
Tom Bedford
15,645 Points

check this thread

specifically, it wants only divs with a class of footer, not "anything" with a class of footer

James Barnett
James Barnett
39,199 Points

Tom Bedford

That's an awesome hint, which I actually just used spot my mistake on this very code challenge.

I think that hint is a great example of what we try to do forum, which is give help not answers and is actually a much better way to help someone learn rather than just giving the answer away like in the linked thread.

Ams BM
Ams BM
5,898 Points

Dear Tom

Thank you for this... I have been stuck on this question for the past four days :-( My code was working with

.footer & { color: purple;}

I was unaware in css you can add

div.footer & { color: purple:}

Cathrine Alvin
Cathrine Alvin
12,184 Points

Thanks Tom! This answer solved the problem for me too :)

Aaron Brewer
Aaron Brewer
7,939 Points

Thank you very much Tom!

Rod Barbee
Rod Barbee
11,935 Points

Just what I was looking for! This was a learning experience I won't soon forget :-)

Thanks I finally pasted the test :)