# animation-name

> The `animation-name` CSS property specifies the name of the keyframe animation that should be applied to an element.

## How do I connect @keyframes to an element in CSS?

The property that specifies the name of the animation defined by `@keyframes`. It associates the keyframes with the element, indicating to the browser which animation to apply based on the sequence of styles.

- 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
.badge {
  animation-name: Pop;
  animation-duration: 0.3s;
}
@keyframes pop {
  from { scale: 0.8; }
}
```

Right:

```css
.badge {
  animation-name: pop;
  animation-duration: 0.3s;
}
@keyframes pop {
  from { scale: 0.8; }
}
```

Keyframe names are case-sensitive, so 'Pop' doesn't match `@keyframes pop`.

## Common mistakes

- A typo in the name makes the animation silently do nothing.
- Two `@keyframes` rules share one name, and only the last one is used.

## Key points

- Every name matches a defined `@keyframes` rule exactly, including letter case.
- Names are specific, like 'fade-in-up', so they don't collide with keyframes from other stylesheets.

## Interview questions

### What happens if animation-name doesn't match any @keyframes?

No animation runs and no error is shown, so the element keeps its normal styles.

### Can I list several animation names?

Yes. Separate names with commas; the other animation longhands map to them by position.

## Related cards

- [@keyframes](https://wonderium.dev/css/keyframes.md)
- [animation](https://wonderium.dev/css/animation.md)
- [animation-duration](https://wonderium.dev/css/animation-duration.md)
- [animation-composition](https://wonderium.dev/css/animation-composition.md)

---

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