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 trialRazvan Ciocanel
16,944 PointsHow can I solve this nesting issue?
I have to create an exception for an a tag that is in the .footer div. This is the bit of code I used:
a {
color: red;
.footer & {
color:purple;
}
}
Any ideas why this ain't working?
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Razvan,
Do you have all that nested inside a p
block?
You have the &
in the right spot. The challenge wants you to be more specific with the selector. It's a div with a class of "footer". Not just any element with a class of "footer"
Razvan Ciocanel
16,944 PointsThanks so much, adding div.footer & worked! :)
Stephen Goeddel
11,239 PointsTry using &.footer
instead.
Razvan Ciocanel
16,944 Pointstried that too, but it just says: "Bummer! Please use the ampersand selector following the selector for the .footer div."
Wayne Priestley
19,579 PointsHi Razvan,
It looks to me like you've created the code so that you have an exception for a .footer
thats created in an a
tag.
In other words, the wrong way round. at least thats how it appears to me, its been a little while since I used any Sass.
Wayne Priestley
19,579 PointsWayne Priestley
19,579 PointsHi Razvan,
I edited your code so it is easier to read.
How to use Markdown to display your code