# animation-play-state

> The `animation-play-state` CSS property specifies whether an animation is running or paused.

## How do I pause a CSS animation on hover?

The property that controls whether the animation is running or paused. It's useful for interactive elements where users control the animation.

- Topic: Animations
- Type: property
- Browser support: Chrome 43+, Chrome Android 43+, Edge 12+, Firefox 16+, Firefox Android 16+, Safari 9+, Safari iOS 9+

## Example

Wrong:

```css
.marquee:hover {
  animation: none;
}
```

Right:

```css
.marquee:hover {
  animation-play-state: paused;
}
```

'paused' freezes the animation where it is, while `animation: none` removes it and resets the element.

## Common mistakes

- Setting `animation: none` to pause, so the element jumps back to the start.

## Key points

- Pausing uses `animation-play-state: paused` instead of removing the animation, which resets it.
- Long or looping animations have a visible pause control, not only a hover state.

## Interview questions

### How do I pause a CSS animation from JavaScript?

Set `element.style.animationPlayState = 'paused'`, or call `pause()` on an animation from `element.getAnimations()`.

### Does a paused animation resume from the same point?

Yes. Switching back to 'running' continues from where it was paused.

## Related cards

- [animation](https://wonderium.dev/css/animation.md)
- [:hover](https://wonderium.dev/css/hover.md)
- [animation-iteration-count](https://wonderium.dev/css/animation-iteration-count.md)
- [@media](https://wonderium.dev/css/media.md)

---

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