CSS Animations allow you to animate transitions from one CSS style configuration to another. Unlike Transitions, which triggered by a state change (like hover), Animations can run automatically and loop infinitely.
@keyframes RuleTo use CSS animation, you must first define some keyframes for the animation. Keyframes hold the style definitions for specific points in the animation timeline.
@keyframes example {
from { background-color: red; }
to { background-color: yellow; }
}
/* Or using percentages for more steps */
@keyframes multicolor {
0% { background-color: red; }
50% { background-color: blue; }
100% { background-color: red; }
}
@keyframes rule you want to use.2s).ease, linear).3, infinite)..box {
/* name duration timing-function delay iteration direction fill-mode */
animation: bounce 2s ease-in-out infinite;
}