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

check will not pass

the question wants to use the & to select the <a> tags in the footer and change the color to purple. shen i preview my code the <a> in the footer is purple but the heck still won't pass my code. Am I doing something incorrect? Here is the question and my code:

Question: 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.

My Answer:

/* Write your SCSS code below. */

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

2 Answers

I remember being similarly frustrated by this one. So, a couple things that appear to be amiss.

  1. Both of the a tags are supposed to be nested inside the p
  2. The challenge wants you to select div.footer & rather than .footer &

That was what worked for me.

Sarah Bradberry
Sarah Bradberry
7,115 Points

That sounds very familiar.

Thanks Michael, It was just missing the div missing everything else was fine.

Sarah Bradberry
Sarah Bradberry
7,115 Points

I found the Sass challenges to be quite odd when it comes to blank spaces. I'd try putting them on the same line like your previous code.

James Barnett
James Barnett
39,199 Points

Don't know how'd that matter

Sarah Bradberry
Sarah Bradberry
7,115 Points

I did find one that only passed when I put all the code on one line. Darned if I can remember what it was though. I probably had a syntax error caused by a space or something?