Press Depth

On hover/focus the image looks pressed INTO the page: the outer drop-shadow shrinks while an inset shadow grows at the edges.

Press Depth demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.press-depth img{
  transition: box-shadow 0.35s ease;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.3),
    inset 0 0 0 0 rgba(0, 0, 0, 0);
}
.hover-effect.press-depth:hover img,
.hover-effect.press-depth:focus-visible img{
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    inset 0 0 0 6px rgba(0, 0, 0, 0.18);
}

The animates its box-shadow from a raised drop-shadow to a tight drop-shadow plus an inset halo on hover/focus, conveying depression. Select the code and copy with Ctrl+C or ⌘C.