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 trialKamila Mielczarek
3,294 PointsIs this an error?
When I had the following in my code, I was getting the answer "wrong":
/* Write your SCSS code below. */ p { a { color: red; &:hover { opacity: 0.5; } }
a { color: blue; } }
Why did I need to add another hover declaration inside the > a selector to make it "pass"? Wouldn't just setting it on all the a tags make it work across all? Or is the > a overriding the :hover state already defined?
1 Answer
Juan Jose Cortes Guzman
7,894 PointsHi Kamila, the code for the opacity should be putted inside the direct children selector in order to pass.
p {
a { color: red;
}
> a {
color: blue;
&:hover {
opacity: 0.5;
}
}
}