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

Css Selectors

Please, Can anyone explain the difference between these two selectors 1) .navbar ul 2) ul.navbar

4 Answers

Check out section entitled selector order matters from this article: http://css-tricks.com/little-css-stuff-newcomers-get-confused-about/

Thank you got it right :D

.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>```

.navbar selects all elements, that have the class "navbar"

ul.navbar select just all ul-Elements, that have the class "navbar"

the first one is , >> .navbar ul

the first one is , >> .navbar ul

the first one is , >> .navbar ul

You were right :D thanks :D

Dude its like this :

.navbar ul

div class="navbar" ul /ul /div

===============================

ul.navbar

ul class="navbar" /ul

thank you so damm much :D