CSS: Animation vs. Transition

It looks like you’ve got a handle on how to do them, just not when to do them.

A transition is an animation, just one that is performed between two distinct states – i.e. a start state and an end state. Like a drawer menu, the start state could be open and the end state could be closed, or vice versa.

If you want to perform something that does not specifically involve a start state and an end state, or you need more fine-grained control over the keyframes in a transition, then you’ve got to use an animation.

Leave a Comment