Shadow Reveal

A layered box-shadow fades in on hover/focus, lifting the image off the page with subtle depth.

Shadow Reveal demo

Hover or focus the image to see the effect.

HTML

description

CSS

.hover-effect.shadow-reveal img{
  transition: box-shadow 0.4s ease;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
.hover-effect.shadow-reveal:hover img,
.hover-effect.shadow-reveal:focus-visible img{
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.15);
}

The animates from a transparent shadow to a two-layer drop shadow on hover/focus, creating subtle depth. Select the code and copy with Ctrl+C or ⌘C.