<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi" -->

---
title: Ken Burns Effect in CSS: Pan and Zoom Animation | daily.dev
description: You can build the Ken Burns effect, a slow pan and zoom on a still image, with one CSS keyframes animation. Put the image in a 450 by 300 pixel container with...
canonical: https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Ken Burns Effect in CSS: Pan and Zoom Animation | daily.dev
og:description: You can build the Ken Burns effect, a slow pan and zoom on a still image, with one CSS keyframes animation. Put the image in a 450 by 300 pixel container with...
og:url: https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi
og:image: https://api.daily.dev/og/posts/0HVN9BKyI.png
og:image:alt: Ken Burns Effect in CSS: Pan and Zoom Animation
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Ken Burns Effect in CSS: Pan and Zoom Animation

**[Kirupa](https://daily.dev/sources/kirupa)** · 11 min read · 0 upvotes · 0 comments

## Summary

You can build the Ken Burns effect, a slow pan and zoom on a still image, with one CSS keyframes animation. Put the image in a 450 by 300 pixel container with overflow: hidden so it clips like a viewport. At the 95% keyframe, combine scale3d(1.5, 1.5, 1.5) to zoom with translate3d(-190px, -120px, 0px) to pan. Run it with animation: kenburns 20s infinite. A prefers-reduced-motion query turns the animation off, and a Pause button toggles animation-play-state: paused. Plain scale and translate perform just as well as the 3d versions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.kirupa.com/html5/ken_burns_effect_css.htm>

## Questions this post answers

### How do I create a Ken Burns pan and zoom effect on an image using only CSS?

Place the image in a fixed-size container with overflow: hidden so the container clips it like a viewport. Then define a keyframes animation that combines scale3d to zoom and translate3d to pan. In the example, the 95% keyframe uses scale3d(1.5, 1.5, 1.5) and translate3d(-190px, -120px, 0px), run with animation: kenburns 20s infinite.

_Developers learning CSS animation techniques can keep up with them on daily.dev._

### How do I make a looping CSS animation respect prefers-reduced-motion and let users pause it?

Wrap an animation: none rule for the image in a prefers-reduced-motion: reduce media query, so users who ask for less motion see a still photo. Because the animation loops forever, also add a Pause button that toggles a class setting animation-play-state: paused, since WCAG expects a way to pause motion lasting over five seconds.

_Anyone shipping accessible motion in CSS can follow accessibility practices on daily.dev._

### Do I still need translate3d and scale3d instead of translate and scale for smooth CSS animations?

No. The 3d versions used to be a trick for nudging the browser into handing an animation to the graphics card, but browsers already do that for CSS animations of transform and opacity. Plain scale and translate work just as well. Large images still cost memory and work to move, so keep them no bigger than needed.

_Front-end developers weighing CSS performance tricks can follow web performance discussions on daily.dev._

## Similar posts on daily.dev

- [Pulsing Circle Animation in CSS: Create a Pulse Effect](https://daily.dev/posts/pulsing-circle-animation-in-css-create-a-pulse-effect-wcodf6ep2) · Kirupa · 2 upvotes · 0 comments
- [Exploring 3D Image Rotations on Scroll](https://daily.dev/posts/exploring-3d-image-rotations-on-scroll-e05yzexmt) · Codrops · 0 upvotes · 0 comments
- [Recreating Apple’s Vision Pro Animation in CSS](https://daily.dev/posts/recreating-apple-s-vision-pro-animation-in-css-de7qk8yoq) · CSS-Tricks · 10 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css), [#accessibility](https://daily.dev/tags/accessibility)

[View this post on daily.dev](https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Ken Burns Effect in CSS: Pan and Zoom Animation","url":"https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi"},"datePublished":"2026-11-28T06:30:38.222Z","dateModified":"2026-11-28T06:30:58.598Z","description":"You can build the Ken Burns effect, a slow pan and zoom on a still image, with one CSS keyframes animation. Put the image in a 450 by 300 pixel container with...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b910337d44621465e2966239c5a2ebd7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b910337d44621465e2966239c5a2ebd7?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Kirupa","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kirupa","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ff2fdb4927d34b81bd07cd18d6049a98","url":"https://daily.dev/sources/kirupa"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,css,accessibility","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kirupa","item":"https://daily.dev/sources/kirupa"},{"@type":"ListItem","position":3,"name":"Ken Burns Effect in CSS: Pan and Zoom Animation"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/ken-burns-effect-in-css-pan-and-zoom-animation-0hvn9bkyi#faq","mainEntity":[{"@type":"Question","name":"How do I create a Ken Burns pan and zoom effect on an image using only CSS?","acceptedAnswer":{"@type":"Answer","text":"Place the image in a fixed-size container with overflow: hidden so the container clips it like a viewport. Then define a keyframes animation that combines scale3d to zoom and translate3d to pan. In the example, the 95% keyframe uses scale3d(1.5, 1.5, 1.5) and translate3d(-190px, -120px, 0px), run with animation: kenburns 20s infinite. Developers learning CSS animation techniques can keep up with them on daily.dev."}},{"@type":"Question","name":"How do I make a looping CSS animation respect prefers-reduced-motion and let users pause it?","acceptedAnswer":{"@type":"Answer","text":"Wrap an animation: none rule for the image in a prefers-reduced-motion: reduce media query, so users who ask for less motion see a still photo. Because the animation loops forever, also add a Pause button that toggles a class setting animation-play-state: paused, since WCAG expects a way to pause motion lasting over five seconds. Anyone shipping accessible motion in CSS can follow accessibility practices on daily.dev."}},{"@type":"Question","name":"Do I still need translate3d and scale3d instead of translate and scale for smooth CSS animations?","acceptedAnswer":{"@type":"Answer","text":"No. The 3d versions used to be a trick for nudging the browser into handing an animation to the graphics card, but browsers already do that for CSS animations of transform and opacity. Plain scale and translate work just as well. Large images still cost memory and work to move, so keep them no bigger than needed. Front-end developers weighing CSS performance tricks can follow web performance discussions on daily.dev."}}]}
```

