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

Sass Basics : post-selector ampersand

i wrote ``` p { a { color: red; }

a { color: blue; &:hover { opacity: 0.5; } } }

a { .footer & { color: purple; } } ```

it says: Bummer! Please use the ampersand selector following the selector for the .footer div.

i don't understand whats missing

2 Answers

Hi Muhammad,

The challenge wants you to be a little more specific with your selector. It's a div with a class of "footer"

Also, you should probably be nesting that above in your a rule.

Like this:

p {
  a {
    color: red;

    div.footer & {
      color: purple;
    }
  }

  > a {
    color: blue;
    &:hover {
      opacity: 0.5;
    }
  }
}

It looks like your code will pass all the way through once you add the div in front of .footer.

So it looks like 3 different answers will pass for task 4. It also passes when you nest it inside the direct child rule.

I don't think the directions are clear enough on what the final compiled selector should be.

It passes when the final compiled selector is div.footer p a or div.footer p > a or in your case div.footer a

Christopher Norkett
Christopher Norkett
5,711 Points

I got up to task 4 and I got stuck at the same spot. I kept trying to use .footer & and not div.footer. I suppose it is better practice to use div.footer, I just wasn't expecting it to be needed.