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

Nav Link Box Shadow

Does anyone know how to apply a box shadow to a nav link? Every time I try it puts a box around the a link and applies the box shadow to that, instead of the text itself which is what i'm looking for.

Assuming the link is text, try text-shadow.

nav ul li {
    text-shadow: 1px 1px #888;
}

2 Answers

Hi Anthony,

The box-shadow property isn't designed for text, instead what you're looking for is the text-shadow property which I've linked to below.

The main difference is box-shadow applies to the entire outside/inside of a block level container whereas text-shadow applies only to the text node and nothing outside of it.

https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow

thanks! I just realized that before looking at this, thanks for the quick reply!