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

Getting "square" box-shadow around transparent background PNG. How do I curve a css shadow around an image?

Getting "square" box-shadow around transparent background PNG. How do I curve a css shadow around an image?

Problem

Possible Duplicate:
Can you add a non-square drop Shadow to PNG content with CSS?

Thanks for checking out my question.

Having an issue where by I am setting the hover of an image in css to have a box-shadow:

But the shadow is a square around the image, rather than following the path around the guy in the picture.

The image is a PNG-24 with a Transparent Background. Am I making a stupid mistake somewhere? Can this actually be done or do I need to somehow remove the square canvas from within Photoshop or swap out the image for the same one with a shadow via javascript?

Many thanks for any suggestions :)

Problem courtesy of: Christian

Solution

its not possible with CSS. Use image sprite & change background position on hover.

Here is the working fiddle

Solution courtesy of: SVS

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

Getting "square" box-shadow around transparent background PNG. How do I curve a css shadow around an image?

×

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

Get updates delivered right to your inbox!

Thank you for your subscription

×