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 trialTimothy Hooker
15,323 PointsI am unclear what is wrong with my code for this Sass request that I create a hover style for direct descendants of a.
p {
a {
color: red;
}
a { color: blue; &:hover { opacity: 0.5; } }
3 Answers
geoffrey
28,736 Pointsp{
a{
color:red;
}
&>a{
color:blue;
&:hover{
opacity:0.5;
}
}
}
motty
21,787 PointsHey Timothy, firstly there was no real need to add an 'a' tag that wasn't a direct descendant. But the real issue was simply that you forgot one closing bracket.
p {
a { color: blue; &:hover { opacity: 0.5; } } }
Jason Anello
Courses Plus Student 94,610 PointsHi Motty,
The 1st task of the challenge requests that all <a>
tags within <p>
tags are colored red. So I think you need that first nested selector. The html even has a link that's two levels deep and should be colored red.
Timothy Hooker
15,323 PointsThanks fellas