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 - 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

check this thread

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

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.

Can't agree more!

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:}

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

Thank you very much Tom!

:-D

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

Thanks I finally pasted the test :)