© Joe Attardi 2020
J. AttardiModern CSShttps://doi.org/10.1007/978-1-4842-6294-8_9

9. Transitions and Animations

Joe Attardi1 
(1)
Billerica, MA, USA
 

CSS transforms are useful on their own, but they are even more powerful when used in combination with transitions and animations.

Transitions

A CSS transition is a way of animating an element from one state to another. They are similar to, but not quite the same as, CSS animations.

During the lifetime of a page, an element’s CSS properties can change. For example, the user could hover over an element, triggering the :hover pseudo-class, which could apply some different styling. Or, maybe, a class is added to or removed from an element with JavaScript. In both of these cases, any style changes are applied ...

Get Modern CSS: Master the Key Concepts of CSS for Modern Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.