- Home
- /
- Tutorials
- /
- CSS Tutorial
- /
- CSS Animations
CSS Animations & Transitions
CSS Animations
CSS Animations allow elements to change styles automatically over time without requiring JavaScript.
Unlike transitions, which require a state change such as hover, animations can run automatically and continuously. The supporting concepts are explained in Scroll Animations and View Transitions.
CSS Animations are commonly used for:
- Loading indicators
- Bouncing buttons
- Image sliders
- Attention-grabbing effects
- Interactive UI elements
Animations are created using:
@keyframes- Animation properties
Syntax
Step 1: Create Keyframes
Create Keyframes
css
@keyframes animation-name {
from {
property: value;
}
to {
property: value;
}
}