Shadow on Shapes

Published: March 8, 2020

You can't use box-shadow on elements with clip-path or images(png or svg) that are transparent. We have to use filter and drop-shadow. For images, you can use the filter directly. But for clip-path, it needs to be a child element (::before can be used to avoid wrapper elements).

css
filter: drop-shadow(1px 5px 5px red);

filter

clip-path
a star
png/svg

box-shadow

clip-path
a star
png/svg