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 Basics Controlling Layout with CSS Display Modes Using Inline-Block to Set Width, Height, Top and Bottom Margin and Padding

Jesse Dispoto
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jesse Dispoto
Front End Web Development Techdegree Graduate 14,538 Points

Can't we just edit the html and nest the <li> tag within the <a> tag, to achieve the same thing?

Gil has the <li> element followed by the <a> tag, you can just put the <li> element within the <a> and you will get the same effect as changing the display property

1 Answer

Eric M
Eric M
11,545 Points

Hi Jesse,

You're right that the behaviour of the link areas would be similar in both cases. When HTML, CSS, and JavaScript combine there's often a number of different ways to achieve the same result. It's great you're able to see the similarities in site behaviour to other techniques.

In this video Gil is illustrating some different aspects of the inline-block display setting. It might not always be the tool that you reach for but it's good to know what it can do.

Cheers,

Eric