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

Challenge task 4 of 4 in Advanced Nesting

On challenge 4 of 4 it asks you 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."

I'm clueless. I'm not sure how to do this without just adding:

.footer a { color: purple; }

My code for the first 3 challenges:

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

2 Answers

Tom Bedford
Tom Bedford
15,645 Points

Hi Chris, take a look at this thread.

I searched the forum for "Advanced Nesting" woth no luck, whoops. Thanks for the link.

Tom Bedford
Tom Bedford
15,645 Points

Things to tend to get buried here rather quickly, I wonder if Treehouse could devise a way to link threads to a certain video/challenge.

Easiest way to search is to Google the question with team treehouse in the search too.

I would watch the video again but im sure its something like

div.footer a & { color: purple; }

I did watch the video again! I will see if this is accepted and try to wrap my head around it, thanks man.

Chris Stauffer let me know if it works

Didn't work, the validator was looking for something like this:

p {
    a {
        color: red;
        div.footer & {
            color: purple
        }
    }
}