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 How to Make a Website Styling Web Pages and Navigation Polish the Navigation and Footer

cant we specify anchor element style in (nav li) it self

here the code is given as

nav li { display:linline-block;} nav a{ font-weight: 800; padding : 15px 10 px} rather than going that way cant we go like this

nav li{ display:inline-block; font-weight: 800; padding : 15px 10 px;}

wont they both give the same results

1 Answer

Ron McCranie
Ron McCranie
7,837 Points

The font-weight should get inherited but the padding is different. The padding on the <a> would create a larger clickable area for the link, while putting the padding on the <li> would still give you some visual space but it wouldn't be clickable for the link.