Hund

How to add shadows to transparent images using CSS

May 23, 2021

This is an transparent image that I made in Inkscape. The shadows is added with CSS.

The CSS-class looks like this:

img {
    filter: drop-shadow(1px 3px 5px rgba(0,0,0,0.55));
}

A good use case for this would be if you want to have shadows around your images in your articles, but don’t want non-square images to look weird.

Meta

No Comments

Use the e-mail form, if you wish to leave feedback for this post. Markdown is supported. [Terms of service]