Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How do I prevent box shadow from showing over another element?

How do I prevent box shadow from showing over another element?

Problem

So I've run into this problem a lot but not until a recent project did it bug me immensely.

Lorem Ipsum
Lorem Ipsum

Basically, the situation goes: I have an Element with an image or text that goes before another element which incorporates Box Shadow. The box shadow would then proceed to go over the first element, when I want the first element to be "in front of" (if that makes sense) the second element's shadow. How would I be able to do that? I tried z-index, but that didn't really seem to work?

Problem courtesy of: 01jayss

Solution

z-index will work. Make sure to utilize positioning (absolute, relative, or fixed) on the elements.

Solution courtesy of: John Green

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

How do I prevent box shadow from showing over another element?

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×