# animation-range

> The `animation-range` CSS property sets the start and end of a scroll-driven animation along its timeline.

## How do I control when a scroll-driven animation starts and ends?

The property that defines the part of the timeline during which an animation runs, for example from 'entry' to 'exit' of an element in the scrollport. A shorthand for `animation-range-start` and `animation-range-end`.

- Topic: Animations
- Type: property
- Browser support: Chrome 115+, Chrome Android 115+, Edge 115+, Firefox 159+, Firefox Android 159+, Safari 26+, Safari iOS 26+

## Example

Wrong:

```css
.card {
  animation-range: entry;
  animation: reveal linear both;
  animation-timeline: view();
}
```

Right:

```css
.card {
  animation: reveal linear both;
  animation-timeline: view();
  animation-range: entry;
}
```

The `animation` shorthand resets `animation-range`, so the range goes after it.

## Common mistakes

- Setting `animation-range` before `animation`, so the shorthand resets it to 'normal'.

## Key points

- Named ranges like 'entry', 'exit', 'cover' and 'contain' are used with a `view()` timeline.
- `animation-range` is declared after the `animation` shorthand, which resets it.
- Fill mode is 'both' or 'forwards', so the element doesn't snap back outside the range.
- Motion is removed or reduced inside `@media (prefers-reduced-motion: reduce)`.

## Interview questions

### What does animation-range: entry 0% cover 50% mean?

The animation starts when the element begins to enter the scrollport and ends when it is halfway through the full 'cover' range.

### Can I use pixel values in animation-range?

Yes. Ranges accept lengths and percentages, like `animation-range: 100px 500px` on a `scroll()` timeline.

## Related cards

- [animation-timeline](https://wonderium.dev/css/animation-timeline.md)
- [view()](https://wonderium.dev/css/view-function.md)
- [scroll()](https://wonderium.dev/css/scroll-function.md)
- [animation-fill-mode](https://wonderium.dev/css/animation-fill-mode.md)
- [@keyframes](https://wonderium.dev/css/keyframes.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/animation-range
- Last updated: 2026-11-25
