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 trialKristian Woods
23,414 PointsWhat 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
Moldoveanu Mihnea
7,454 Points".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
Andrew Smirnov
4,982 PointsHi, 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"
Kristian Woods
23,414 PointsThanks dudes!
Andrew Smirnov
4,982 PointsKristian, you are welcome! Rate me, thanx in advance!