SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/image-hover-effects

7 CSS Image Hover Effects

7 Pure CSSPublished 2026-10-05Free · no sign-up

Seven hover effects for images: a zoom inside a fixed frame, grayscale photos that turn to colour, a caption that slides up, an overlay with a magnifier, a gallery that blurs everything except the image you point at, a brand-coloured duotone wash and a thin inset frame.

01. Zoom Inside the Frame

ImageHover

The image scales up slightly inside a fixed frame on hover, the most common image hover there is. The frame has overflow: hidden and the link around it carries the focus style, so the same zoom shows for keyboard users.

View code
<a class="ih1" href="#journal"><span class="fr"><span class="im" role="img" aria-label="Coffee and notebook on a desk"></span></span><span class="t">How we plan a product launch</span></a>
.ih1 { display: grid; gap: 8px; width: 260px; max-width: 100%; color: #101828; font: 700 15px Inter, system-ui, sans-serif; text-decoration: none; }
.ih1 .fr { overflow: hidden; border-radius: 14px; }
.ih1 .im { display: block; aspect-ratio: 16 / 10; background: radial-gradient(circle at 30% 60%, #78350f 0 14%, transparent 15%), radial-gradient(ellipse at 70% 50%, #fef3c7 0 24%, transparent 25%), #d6c3a5; transition: transform .5s ease; }
.ih1:hover .im, .ih1:focus-visible .im { transform: scale(1.07); }
.ih1:focus-visible { outline: 3px solid #84adff; outline-offset: 4px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .ih1 .im { transition: none; } }

02. Grayscale to Colour

ImageFilter

Team photos sit in grayscale and come to life in colour when hovered or focused, a neat way to keep a grid of mixed photos looking consistent. It is a filter transition, so the image itself never changes.

View code
<ul class="ih2"><li><a href="#ines"><span class="im" style="--g:linear-gradient(160deg,#fcd34d,#ea580c)"></span><span>Inês</span></a></li><li><a href="#tom"><span class="im" style="--g:linear-gradient(160deg,#67e8f9,#2563eb)"></span><span>Tom</span></a></li><li><a href="#yara"><span class="im" style="--g:linear-gradient(160deg,#f9a8d4,#9333ea)"></span><span>Yara</span></a></li></ul>
.ih2 { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; box-sizing: border-box; max-width: 100%; font: 600 13px Inter, system-ui, sans-serif; }
.ih2 a { display: grid; gap: 6px; color: #e2e8f0; text-decoration: none; text-align: center; }
.ih2 .im { display: block; width: 86px; aspect-ratio: 3 / 4; border-radius: 12px; background: var(--g); filter: grayscale(1) contrast(.9); transition: filter .4s ease; }
.ih2 a:hover .im, .ih2 a:focus-visible .im { filter: none; }
.ih2 a:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: 12px; }

03. Caption Slides Up Over the Image

ImageCaption

A caption panel slides up from the bottom edge on hover or focus, with a gradient behind it so the white text stays readable over any photo. On touch screens the caption is always visible.

View code
<a class="ih3" href="#villa"><span class="im" role="img" aria-label="White villa above the sea"></span><span class="cap"><b>Villa Azul</b> Sleeps 6 · from €240 a night</span></a>
.ih3 { position: relative; display: block; width: 260px; max-width: 100%; overflow: hidden; border-radius: 14px; font-family: Inter, system-ui, sans-serif; text-decoration: none; }
.ih3 .im { display: block; aspect-ratio: 4 / 3; background: linear-gradient(#bae6fd 45%, #0ea5e9 45% 70%, #0369a1 70%); }
.ih3 .cap { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 28px 14px 12px; background: linear-gradient(transparent, rgba(2,6,23,.85)); color: #e2e8f0; font-size: 13px; transform: translateY(100%); transition: transform .35s ease; }
.ih3 .cap b { color: #fff; font-size: 16px; }
.ih3:hover .cap, .ih3:focus-visible .cap { transform: none; }
.ih3:focus-visible { outline: 3px solid #84adff; outline-offset: 3px; }
@media (hover: none) { .ih3 .cap { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ih3 .cap { transition: none; } }

04. Overlay with Zoom Icon

ImageOverlay

A dark overlay and a magnifier icon fade in over the image to say it opens larger. The link's accessible name says Open larger image of a red tram, which describes both the image and what the click does.

View code
<a class="ih4" href="#tram-large" aria-label="Open larger image of a red tram"><span class="im" aria-hidden="true"></span><span class="ov" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="6"/><path d="M20 20l-4.5-4.5M11 8v6M8 11h6"/></svg></span></a>
.ih4 { position: relative; display: block; width: 240px; max-width: 100%; overflow: hidden; border-radius: 14px; }
.ih4 .im { display: block; aspect-ratio: 1; background: linear-gradient(#fde68a 0 40%, #dc2626 40% 75%, #44403c 75%); }
.ih4 .ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(2,6,23,.55); opacity: 0; transition: opacity .3s; }
.ih4 svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; transform: scale(.7); transition: transform .3s; }
.ih4:hover .ov, .ih4:focus-visible .ov { opacity: 1; } .ih4:hover svg, .ih4:focus-visible svg { transform: none; }
.ih4:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ih4 .ov, .ih4 svg { transition: none; } }

05. Others Blur When One Is Hovered

ImageGallery

In a gallery, hovering one image blurs and dims the rest so the chosen one stands out. :has() on the grid detects that something inside is hovered and styles every image that is not, with no JavaScript.

View code
<ul class="ih5"><li><a href="#p1" style="--g:linear-gradient(135deg,#fb923c,#be123c)" aria-label="Photo 1"></a></li><li><a href="#p2" style="--g:linear-gradient(135deg,#34d399,#0f766e)" aria-label="Photo 2"></a></li><li><a href="#p3" style="--g:linear-gradient(135deg,#818cf8,#4338ca)" aria-label="Photo 3"></a></li><li><a href="#p4" style="--g:linear-gradient(135deg,#facc15,#a16207)" aria-label="Photo 4"></a></li></ul>
.ih5 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 240px; max-width: 100%; margin: 0; padding: 0; list-style: none; }
.ih5 a { display: block; aspect-ratio: 1; border-radius: 12px; background: var(--g); transition: filter .3s, opacity .3s, transform .3s; }
.ih5:has(a:hover) a:not(:hover), .ih5:has(a:focus-visible) a:not(:focus-visible) { filter: blur(2px) grayscale(.6); opacity: .6; }
.ih5 a:hover, .ih5 a:focus-visible { transform: scale(1.04); }
.ih5 a:focus-visible { outline: 3px solid #528bff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ih5 a { transition: none; } .ih5 a:hover, .ih5 a:focus-visible { transform: none; } }

06. Duotone on Hover

ImageBlend

A colour wash in two brand colours sits over the image with mix-blend-mode, turning any photo into an on-brand duotone; hover lifts the wash to show the original. It is a common way to make stock photos feel part of one design.

View code
<a class="ih6" href="#story"><span class="im" role="img" aria-label="Mountain lake at dawn"></span><span class="wash" aria-hidden="true"></span><span class="t">Read the story</span></a>
.ih6 { position: relative; display: block; width: 260px; max-width: 100%; overflow: hidden; border-radius: 14px; font-family: Inter, system-ui, sans-serif; text-decoration: none; }
.ih6 .im { display: block; aspect-ratio: 4 / 3; background: linear-gradient(#fde68a, #fb923c 35%, #1e3a8a 36% 60%, #0f172a 61%); }
.ih6 .wash { position: absolute; inset: 0; background: linear-gradient(135deg, #db2777, #312e81); mix-blend-mode: color; transition: opacity .4s; }
.ih6 .t { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 6px; background: #fff; color: #0f172a; font-weight: 700; font-size: 13px; }
.ih6:hover .wash, .ih6:focus-visible .wash { opacity: 0; }
.ih6:focus-visible { outline: 3px solid #f9a8d4; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ih6 .wash { transition: none; } }

07. Inset Frame Appears

ImageBorder

A thin white frame draws itself inside the image edge on hover, a gallery-style touch for portfolios. The frame is an outline on a pseudo-element with a negative offset, scaling in from slightly larger, so it never affects the layout.

View code
<a class="ih7" href="#series"><span class="im" role="img" aria-label="Abstract blue and orange painting"></span></a>
.ih7 { position: relative; display: block; width: 240px; max-width: 100%; overflow: hidden; border-radius: 6px; }
.ih7 .im { display: block; aspect-ratio: 4 / 5; background: radial-gradient(circle at 30% 30%, #fb923c 0 22%, transparent 23%), radial-gradient(circle at 70% 70%, #1d4ed8 0 30%, transparent 31%), #f1f5f9; }
.ih7::after { content: ""; position: absolute; inset: 14px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); opacity: 0; transform: scale(1.08); transition: opacity .35s, transform .35s; pointer-events: none; }
.ih7:hover::after, .ih7:focus-visible::after { opacity: 1; transform: none; }
.ih7:focus-visible { outline: 3px solid #528bff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ih7::after { transition: none; } }

About these CSS Image Hover Effects

Clip the zoom

Wrap the image in a frame with overflow: hidden and scale the image, not the frame. The card keeps its size and the zoom stays inside the rounded corners.

Filters are cheap to change

filter: grayscale(), blur() and contrast() transition smoothly and leave the image file untouched. Avoid blurring very large images on hover, which is heavier.

Effects on the link, not the image

Put the hover and :focus-visible rules on the link that wraps the image, so keyboard users get the same effect, and give the link a name that describes where it goes.

Touch screens show the resting state

There is no hover on phones, so any information revealed on hover, like a caption, should be visible by default under @media (hover: none).

Frequently asked questions

Where are the images?

The demos use gradients as stand-ins. Replace them with img elements with proper alt text.

How does the blur-the-others effect work?

:has() lets the gallery know one item is hovered, and :not(:hover) styles the rest.

Which effect suits product grids?

A gentle zoom or a second product photo on hover; avoid effects that hide the product.