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 trialguram dgebuadze
Front End Web Development Techdegree Student 4,122 PointsquerySelectorAll(' '); While writing this we need css selectors and why do we need > to refer to the child of the elemen
for example querySelectorAll(' #nav > p'); > why do we use this thing in js to refer to child of the nav id, while we don't use it when we are writing in css?
2 Answers
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsYou can use it in CSS as well. >
is for a direct child, but just a space is for any descendant.
This SO thread might help.
guram dgebuadze
Front End Web Development Techdegree Student 4,122 Pointsthanks bro, now it's clear