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 Layout Techniques Float Layout Creating a Horizontal Menu

What is the difference between ".main-nav" and ".main-nav li"?

I'm having difficulties wrapping my head around this. Could someone shed light on the difference between the two?

thanks

4 Answers

".main-nav" = the class that has been defined for the navigation. ".main-nav li" = the list items from the navigation (probably the buttons).

basically: .main-nav reffers to the navigation itself .main-nav li reffers to the elements from the navigation

Hi, Kristian. We use ".main-nav" when we have to work with whole container, and when we want to work with "li" elements inside ".main-nav" we have to write ".main-nav li"

Thanks dudes!

Kristian, you are welcome! Rate me, thanx in advance!