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 trialgaster
Courses Plus Student 3,997 PointsSass basics ampersand challenge.
Seems like I've tried everything to get this to pass... No go! Could someone please help?
Front-end Web Development Challenge task 4 of 4
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.
Bummer! Please use the ampersand selector following the selector for the .footer div.
/* Write your SCSS code below. */ p { a { color: red; } > a { color: blue; &:hover { opacity: 0.5; .footer & { color: purple; } } } }
gaster
Courses Plus Student 3,997 PointsAlright, thank you very much! I'll try that and see if it works. It seems like i've attempted everything but that, so your help is much appreciated!
2 Answers
Todd Brotze
7,461 PointsI can empathize, had the same problem. Turns out they want you to be specific with the selector and indicate "div" ahead of the "footer" class, so it would look like: div.footer& Took me a little while to figure it out. Hopefully that works for you.
gaster
Courses Plus Student 3,997 PointsO.k. I'll try that... Thank you so much! That's one thing I hadn't thought to write.
Tafadzwa Machirori
9,184 Pointsp{ a{ color:red; & div.footer { color: purple;} }
a{ color:blue; &:hover{ opacity:0.5; } } }
Nachiket Kumar
3,590 PointsNachiket Kumar
3,590 PointsThere are 2 issues here:
As Todd says, you need to be more specific (although that is not clear enough from the exercise instructions, you need to say
div.footer
and not just.footer
.You need to nest the post selector ampersand under the
a
tag, not as you currently have it. What you have is actually selecting the&:hover
instead of thea
.Hope that helps