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 trial

CSS Sass Basics (retired) Getting Started with Sass Advanced Nesting

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

Code not working correct p { a { color:red; }

a { color:blue; &:hover { opacity:0.5; } & .footer { color:purple; } } }

3 Answers

Thanks Seth but got the answer The question says to use class .footer with div, so in my posted code it goes this way, div.footer & (declare this in the p tag inside that a tag and inside that div.footer) That's it... But thanks anyways...

Seth Barthen
Seth Barthen
11,266 Points

have you tried nesting this within that class of footer? i've noticed that <a> elements can be weird sometimes and need more specificity than normal tags like your h1's and p's.

maybe something like this... this is Sass based btw

.footer { a { color: purple; (also look up the hex for your purple, some browsers interpret purple to be a different shade) } &:hover { opactiy: 0.5; } }

hopefully that works :)