@keyframes define animation steps. Apply with the animation property: animation: name duration easing. Set iteration-count: infinite for loops. fill-mode: forwards keeps the final state after the animation ends.
CSS Animations
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.card {
animation: fadeIn 0.5s ease forwards;
}
.spinner {
animation: spin 1s linear infinite;
}