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
Amin Ahmed khan
5,371 PointsCss Selectors
Please, Can anyone explain the difference between these two selectors 1) .navbar ul 2) ul.navbar
4 Answers
James Barnett
39,199 PointsCheck out section entitled selector order matters from this article: http://css-tricks.com/little-css-stuff-newcomers-get-confused-about/
Sam Matrouh
14,694 Points.navbar ul will select an unordered list <ul> inside an element with "navbar" class.
<div class="navbar">
<ul>
</ul>
</div>
ul.navbar will select a "navbar" class nested inside an unordered list.
<div class="navbar"></div>
</ul>```
Andre Kettschau
20,054 Points.navbar selects all elements, that have the class "navbar"
ul.navbar select just all ul-Elements, that have the class "navbar"
Amin Ahmed khan
5,371 Pointsthe first one is , >> .navbar ul
Amin Ahmed khan
5,371 Pointsthe first one is , >> .navbar ul
Amin Ahmed khan
5,371 Pointsthe first one is , >> .navbar ul
Amin Ahmed khan
5,371 PointsYou were right :D thanks :D
Mirza Curevac
Courses Plus Student 14,294 PointsDude its like this :
.navbar ul
div class="navbar" ul /ul /div
===============================
ul.navbar
ul class="navbar" /ul
Amin Ahmed khan
5,371 Pointsthank you so damm much :D
Amin Ahmed khan
5,371 PointsAmin Ahmed khan
5,371 PointsThank you got it right :D