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 trialAaron Brewer
7,939 PointsSass 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
Tom Bedford
15,645 Pointscheck this thread
specifically, it wants only divs with a class of footer, not "anything" with a class of footer
Ams BM
5,898 PointsDear 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:}
Cathrine Alvin
12,184 PointsThanks Tom! This answer solved the problem for me too :)
Aaron Brewer
7,939 PointsThank you very much Tom!
Rod Barbee
11,935 PointsJust what I was looking for! This was a learning experience I won't soon forget :-)
Emeline Lise
3,430 PointsThanks I finally pasted the test :)
James Barnett
39,199 PointsJames Barnett
39,199 PointsTom 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.
Cathrine Alvin
12,184 PointsCathrine Alvin
12,184 PointsCan't agree more!