Matt Montenegro's Backstage

CSS image hover trick

by jhey ʕ•ᴥ•ʔ (@jh3yy) · · UI/UX

CSS image hover trick

Trick with two stacked images and clip-path on hover. A practical tutorial.

Post text

one way w/ css 🪄 stack an image 2x filter 1st, unclip 2nd on :hover 🤙 a img { grid-area: 1 / 1; } img:first-of-type { filter: grayscale(1) invert(1); } img:last-of-type { clip-path: circle(0); transition: clip-path; } a:hover img:last-of-type { clip-path: circle(100%); }

Open the post on X ↗Open in the archive

Similar references