Enrique Metner
Enrique Metner

Reputation: 189

shadow effect around image instead of image border

The photo below probably makes the problem obvious but basically, the shadow effect is around the border of the image container instead of the image itself which is not what I want. While keeping object-fit: contain is there a solution to this?

img {
    width: calc(100% - 5px);
    height: calc(100% - 5px);
    object-fit: contain;

    box-shadow: 0 0 5px 5px #0ff;
}

enter image description here

Upvotes: 0

Views: 193

Answers (1)

TwistedOwl
TwistedOwl

Reputation: 1324

This should help:

    filter: drop-shadow(30px 10px 4px #4444dd);

Upvotes: 1

Related Questions