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
Milton Centeno
Courses Plus Student 7,940 Pointsselectors in jQuery
Greetings, In our css file we would select all li elements inside ul elements that have the class of nav like this. .nav ul li {} But this doesn't work for part 2 of 2 of Building Interactive Websites. Please explain the difference. Thank you.
1 Answer
Phillip Gibson
13,805 PointsThat selector actually wouldn't (or at least shouldn't) work in CSS, because the way you have it defined, it would first look for any element with the class .nav then any number of elements deep within it it will select the ul elements, and then again, all of the li elements under that.
You want to specifically select only the ul's that have the .nav class, so it should look like ul.nav li.