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

sass: it wont accept answer. it hates me.

I dont know how to correct this. Im supposed to make an exception for <a> tags using post-selector &... the links in the .footer should be purple. the preview shows I'm right, but it wont accept my answer :/

here's my code for step 4:

/* Write your SCSS code below. */
p {
    a { color: red; 
        .footer & { color: purple; }
  }
  > a { color: blue;
      &:hover { opacity: 0.5;
      }
  }
}

halp?

6 Answers

You are targeting everything with the class of "footer". You want to only target divs with the needed class.

omg it worked :) you were right! the key here was the "all" keyword on the other steps... I changed it to div.footer and it passed :)

Glad I could help.

OMG thanks so much for posting this question and answer. I've enjoyed every quiz/code challenge on Treehouse thus far. Except this one. Wanted to rip out my hair! haha

Samuel Webb
Samuel Webb
25,370 Points

It was taking me forever to figure this out and just putting that div before .footer worked. that was annoying.

Molly Dopheide
Molly Dopheide
11,083 Points

Same here, thanks for the help!

Could I please see how that is written out? This syntax is confusing me.

Samuel Webb
Samuel Webb
25,370 Points

Just went back and tested it out to make sure.

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

To target divs with the class of footer you would write it like this.

div.footer {
  /* styles here */
}
Samuel Webb
Samuel Webb
25,370 Points

I was having some trouble with posting this for a second.