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 trialSilvia Biurrun
558 Pointsat 3:30 mark in video, Guil changed list items to disply:block. Why didn't this cause them to go back to vertical?
Hi, at 3:30 mark in video, Guil changed list items to disply:block. Why didn't this cause them to go back to vertical?
2 Answers
Matthew Carson
5,965 PointsIt looks like he changed the anchor tags within the nav to display:block;
A block level element stretches out to fill all of its available space, which the <a> tag does. It stretches out to fill in the <li> tag.
But those anchor tags themselves are contained within <li> elements that are inline-block, which keeps them in a line
So you're seeing inline <li>s that have block level <a> inside them.
If you were to remove the inline-block display property of the <li> tags they would go vertical like you were expecting.
john larson
16,594 PointsHey Matthew, that makes perfect sense!. If this was my question I'd give you a best answer. I don't suppose you know python, cause I have a question posted. No ones touched it yet.
john larson
16,594 PointsI thought I could answer your question but after watching the video...I have no idea. I can't wait to find out why myself now
john larson
16,594 PointsI opened up workspaces and changed that line to block like Guill, and they lined up on top of each other just like you would expect. So I have no idea what's up with that. Good catch on your part.
Nouh Ahmed
7,085 PointsNouh Ahmed
7,085 PointsI changed the display property of the .name a and main-nav anchors to block and they lined up top of each other.