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 Positioning Elements Side-By-Side with Inline Display

Seth Johnson
Seth Johnson
15,200 Points

Question about the top & bottom padding of inline links.

Towards the end of the video Guil applies the padding (10px 15px) to the inline links in the .main-nav bar, and then proceeds to explain that the browser only really applies the padding to the left & right sides. Except that's not true, the clickable area of the links (on the sides as well as the top & bottom) DOES expand, which I thought was the desired effect; it just doesn't expand to include the links' white background color. So I guess my question is, is there any way to clarify what's happening here?

1 Answer

John Lack-Wilson
John Lack-Wilson
8,181 Points

That's interesting, I wasn't aware that was the case! I had a quick google and found this article to be quite helpful at explaining it.

Seth Johnson
Seth Johnson
15,200 Points

Thanks for the article! I guess this is something I'll have to chalk up to "CSS does this because reason(s) unknown," at least to me at this time. But this is handy info either way.