Skip to content

Image Clipped Text with Photo Fill

Large pure CSS heading filled with a slowly panning mountain photo through background-clip text, with a solid color fallback.

Also known as: image text fill, text with photo inside, background clip text image, photo masked heading, picture filled typography

Pure CSS Text Effects Responsive Dark #animation #heading #hero #image #text

Image Clipped Text with Photo Fill live demo

Open in new tab

Pure CSS code (HTML, CSS)

A huge editorial heading filled with a photograph instead of a flat color, built with pure CSS and background-clip: text. The mountain photo shows only through the letter shapes and drifts slowly inside them. Use it for magazine covers, travel landing pages, portfolio intros or any hero that needs a strong typographic statement.

How it works

The root section.ict-hero holds an eyebrow line, the heading .ict-title, a lead paragraph and a meta row with .ict-chip labels and a .ict-link call to action. The heading contains two .ict-fill spans: the large first line and a smaller second line marked .ict-fill--alt.

Each .ict-fill gets the photo from the --ict-photo custom property as its background-image. With background-clip: text (and the -webkit- prefixed version) the background is cut to the glyph shapes, and -webkit-text-fill-color: transparent removes the text color so the image becomes visible. A heavy display font, uppercase letters and tight line-height give the image as much surface as possible.

The ict-pan keyframes slowly change background-size and background-position, so the photo zooms and slides inside the letters. The second line runs the animation in reverse, which makes the two lines move against each other. Everything is wrapped in @supports; browsers without text clipping show the heading in the solid --ict-fallback color. No JavaScript is used.

The sample photo comes from Unsplash; replace it with your own image.

Customization

  • --ict-photo on .ict-hero: the image shown inside the letters. Pick a photo with strong contrast and detail.
  • --ict-size: the font size of the first heading line; .ict-fill--alt scales from it with 0.62em.
  • --ict-pan-duration: the length of one pan cycle; larger values make the movement calmer.
  • --ict-fallback: the solid text color used when background-clip: text is not supported.
  • --ict-bg, --ict-accent and --ict-muted: the dark background, the peach accent of the eyebrow and button, and the lead text color.
  • Edit the ict-pan keyframes to change the zoom range or the direction of the drift.

Use cases

  • Magazine and editorial covers: a huge headline shows a mountain photo only through the letter shapes
  • Travel landing pages: a slowly panning photo inside the heading sets the mood before any copy
  • Portfolio intros: a bold typographic statement with an eyebrow line, lead paragraph and call to action
  • Dark hero sections: the solid fallback color keeps the heading readable in browsers without text clipping

Accessibility

The heading stays real, selectable text, so screen readers and search engines read "Above the clouds" normally. The section is labelled by the heading through aria-labelledby. The fallback color keeps the text readable where clipping is unavailable, and the photo has dark mid-tones that contrast with the navy background. The link has a visible focus ring. With prefers-reduced-motion: reduce the pan animation and hover transitions are switched off.

Usage notes

Image clipped text works best for short words at very large sizes; long sentences lose the photographic effect. Keep the image size close to the displayed width to avoid loading a heavy file just for the letter shapes.

Image Clipped Text with Photo Fill at a glance

Framework
Pure CSS
Code
HTML, CSS
JavaScript
Not needed, CSS only
Dependencies
None
Layout
Responsive, works on mobile, dark design
Category
Text Effects
License
Free for personal and commercial use

Questions about this template

Can I use the Image Clipped Text with Photo Fill code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear and add the CSS to your stylesheet. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. It is built with HTML and CSS only, so there is no JavaScript to load.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Image Clipped Text with Photo Fill – free Pure CSS text effect template
Image Clipped Text with Photo Fill · free Pure CSS text effect template

More Text Effects

Glitch Text Effect – free Pure CSS text effect template

Glitch Text Effect

Pure CSS glitch heading with sliced cyan and magenta copies, CRT scanlines, and subtle, hover-only and acid palette variants.

Typing Text Effect – free Pure CSS text effect template

Typing Text Effect

Pure CSS typewriter effect with a blinking caret, using steps() and ch units on a monospace headline and a retro terminal window with replay.

Animated Gradient Text – free Pure CSS text effect template

Animated Gradient Text

Pure CSS animated gradient text for headings using background-clip, with four palettes, a shine sweep variant, a CSS-only pause switch and a fallback color.