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 trialJames Barrett
13,253 PointsWhy did my SASS code not pass this challenge?
On part 2 of the challenge, we are required to: 'Add another nested selector which makes all <a> tags that are direct children of <p> tags blue.'
Code that didn't pass:
p {
a {
color: red;
}
> a {
color: blue;
}
}
Code that passed:
p {
a {
color: red;
}
> a {
color: blue;
}
}
Why did putting the '>' selector after the initial nested selector pass? Do both code snippets produce different outputs?
Thanks, James.
1 Answer
Andrew McCormick
17,730 Pointsyour code snippets are the same, but it sounds like you tried putting the direct selector first and it didn't accept that (which I just confirmed). It seems like one of those times where the yest was just looking for a specific way of doing something. Since it asked you to add it, it assumed you would add it after what you did in the previous step, is my best gust.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsWhat's the difference between the two code snippets?