CSS Animations and Transitions Flashcards
1
Q
What is the main difference between CSS Transitions and CSS Animations?
A
CSS Transitions move an element from one state to another smoothly over a duration, with only a start and end state. CSS Animations, on the other hand, allow for multiple steps (keyframes) and can loop or have more control over intermediate states.
2
Q
What is the @keyframes rule used for in CSS animations?
A
The @keyframes rule defines the stages and styles of an animation. It specifies the CSS properties an element will have at specific points in time throughout the animation. You attach the @keyframes rule to an element using the animation-name property.