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 trialByron Horn
3,348 PointsSAAS challenge part 4
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.
I tried several things including } html.footer &: a { color:purple; } }
3 Answers
Chris Dziewa
17,781 Points/* Write your SCSS code below. */
p {
a {
color: red;
div.footer & {
color: purple;
}
}
> a {
color: blue;
&:hover {
opacity: 0.5;
}
}
}
This will work for you. Notice how the div.footer &
selector is nested within the a
tag.
Byron Horn
3,348 PointsHey Chris, Thanks! Worked perfectly and was very helpful.. Really appreciate your assistance Have a great rest of the week.
Byron
Chris Dziewa
17,781 PointsYou are most welcome, and have a great week too!
James Barnett
39,199 PointsByron Horn - Do you understand why Chris Dziewa's code works?
Byron Horn
3,348 PointsHi James, Yes i understand now, sometimes it takes me seeing the correct way to connect the dots. I appreciate the follow up. Have some fun this weekend.
Byron