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 trialAlex Hird
2,767 Pointswhy do i have to input display: inline-block; in nav li and not nav ul.
why do i have to input display: inline-block; in nav li and not nav ul. nav ul contains the list-style:none declaration so why can't it have the display: inline-block declaration. thanks
2 Answers
Jennifer Nordell
Treehouse TeacherIt could, but it's not really needed. An unordered list has a default display of block. A list item doesn't. So you have to tell the list items specifically to display the way that you want. Here's some information from the W3C.
Steve Brewer
15,030 PointsBecause you want the items in the list, the <li>'s to display inline and as blocks alongside the other items.
Putting it in the ul would make all ul elements display as inline blocks.
Alex Hird
2,767 PointsThanks
Alex Hird
2,767 PointsAlex Hird
2,767 PointsThanks