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
Morten Larsen
12,275 PointsDESCENDANT SELECTOR
HTML <p class="note"> This page was written by <a href="mailto:ivy@example.org">ivy@example.org</a> for <a href="http://www.example.org">Example</a>. </p>
CSS /DESCENDANT SELECTOR/ /Matches an element that is a descendent of another specified element/
p a { color: white; }
^^^^ /Targets any <a> element that sit inside a <p> element, even if there are other elements nested between them/
QUESTION Why dosnt this descendant selector Work? I cant figure why the <a> elements that sit inside the <p> element Arent switching to a color of White?
2 Answers
Morten Larsen
12,275 PointsI found my mistake :)
Not putting the ^^^^ into my comments messed it up :)
Steven Parker
243,331 Points
It's not the ^^^^, but your comments need the proper start/end sequences.
<!-- this is an HTML comment -->
/* this is a CSS comment */