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

Brian Doherty
Brian Doherty
8,165 Points

Cannot get past this task

task 2 on advanced nesting.

2 Answers

Ben Falk
Ben Falk
3,167 Points

This is the correct code, using the direct child symbol ">":

/* Write your SCSS code below. */
p {
    a { 
    color:red; 
  }
    > a {
    color:blue;
  }  
}

The order does seem to matter -- when I put "> a" before the "a" styling, the challenge didn't pass. I think that is because if you switch it, all "p a" become red, and the blue color gets overwritten.

Brian Doherty
Brian Doherty
8,165 Points

Ben you're a legend! Thank you. I was using

.entry p {

     a {color: red;}

}

from the first task so ".entry" was only selecting the .entries and not all the p tags. Thanks again!