🎞️CSS Animation
Also known as CSS Keyframes, @keyframes, CSS Animations
Keyframes written in CSS that the browser plays. It can loop and pass through many steps.
Think of it like
It is like a dance routine written on a card. The browser reads the steps and plays them on its own.
Example
Why it matters
It adds looping motion to a page with no script. The browser runs it smoothly.
Definition
Example code
css
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.3); }
}
.dot {
animation: pulse 1s ease-in-out infinite;
}Common mistake
Key takeaways
- 1Keyframes in CSS. From 0% to 100%.
- 2Runs on its own. No hover needed.
- 3Can loop. Set how many times.