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 trialbenwoodruff
3,204 Pointscheck 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
Michael Pare
6,358 PointsI remember being similarly frustrated by this one. So, a couple things that appear to be amiss.
- Both of the
a
tags are supposed to be nested inside thep
- The challenge wants you to select
div.footer &
rather than.footer &
That was what worked for me.
Sarah Bradberry
7,115 PointsI 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
39,199 PointsDon't know how'd that matter
Sarah Bradberry
7,115 PointsI 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?
Sarah Bradberry
7,115 PointsSarah Bradberry
7,115 PointsThat sounds very familiar.
benwoodruff
3,204 Pointsbenwoodruff
3,204 PointsThanks Michael, It was just missing the div missing everything else was fine.