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 trialManpreet singh
4,826 PointsSass: Advanced Nesting : make all <a> tags that are direct children of <p> tags blue.
GOT IT NEVER MIND
6 Answers
Fernando Teofilo
7,942 PointsThis is what worked for me:
p {
a {
color: red;
}
> a {
color: blue;
}
}
Kyle Pierce
12,612 PointsThis seems backwards. The general is above the specific. I guess I'm use to the if/else from all the programming I have been learning on treehouse.
Christopher Geary
4,531 PointsFor anyone else interested..
/* CSS */
p > a { color: blue; }
/* SASS */
p { & > a { color: blue; } }
scott johnson
12,136 PointsThis worked:
p {
color: blue;
a {
color: red;
}
}
Christopher Tooley
991 Points/* Write your SCSS code below. */
p { color: red; a { color: red; }
a{ color:blue; } } All you have to do is add the > + the following code. a{ color:blue;}
Christopher Tooley
991 Points/* Write your SCSS code below. */
p { color: red; a { color: red; }
a{ color:blue; } }
Logan Eppley
Courses Plus Student 26,697 Pointsp {
color:blue;
}
p a {
color:red;
}
Try this. It worked for me. This may avoid SAS, however it gets the job done. As you can see, the links inside the paragraphs are being targeted.
John Mianomos
863 PointsAvoids Sass and therefore invalidates the lesson... yes, it does.
Justin Breen
511 PointsSolving the test in any way that specifically avoids Sass seems completely redundant and useless and defeats the entire purpose of learning and using Treehouse in general.
Aaron Witherspoon
9,911 PointsAaron Witherspoon
9,911 PointsHi, I am stuck on this and wondering if you can help me. I am trying this : p { > a { color: blue; } a { color: red; }} And can't figure out why its not working... I even tried adding the '&' like Christopher suggested below. Any help would be great.