# animation-timeline

> The `animation-timeline` CSS property specifies the timeline that controls the progress of an animation.

## How do I make a CSS animation run on scroll?

The property that links an animation to a timeline other than the document time. With `scroll()` or `view()` values, animation progress follows scrolling, which creates scroll-driven animations without JS.

- 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
.progress {
  animation-timeline: scroll();
  animation: grow linear;
}
```

Right:

```css
.progress {
  animation: grow linear;
  animation-timeline: scroll();
}
```

The `animation` shorthand resets `animation-timeline`, so the timeline must be declared after it.

## Common mistakes

- Writing `animation-timeline` before `animation`, so the shorthand resets it and the animation runs on time.

## Key points

- Scroll effects use `animation-timeline: scroll()` or `view()` instead of a JavaScript scroll listener.
- `animation-timeline` is declared after the `animation` shorthand, which resets it.
- The effect sits inside `@supports (animation-timeline: scroll())`, and content stays visible without it.
- Motion is removed or reduced inside `@media (prefers-reduced-motion: reduce)`.

## Interview questions

### Can I use a named scroll timeline?

Yes. Set `scroll-timeline-name`, like '--page', on the scroller and use `animation-timeline: --page` on an animated descendant.

### What happens in browsers without animation-timeline support?

The declaration is ignored and the animation runs on normal time, so wrap the effect in `@supports`.

## Related cards

- [scroll()](https://wonderium.dev/css/scroll-function.md)
- [view()](https://wonderium.dev/css/view-function.md)
- [animation-range](https://wonderium.dev/css/animation-range.md)
- [animation](https://wonderium.dev/css/animation.md)
- [@supports](https://wonderium.dev/css/supports.md)

---

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