CSS Animations and Keyframes
Define an animation
@keyframes fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
.notice { animation: fade-in 300ms ease-out both; }
Animation properties
Common properties include animation-name, animation-duration, animation-delay, animation-iteration-count, animation-direction, and animation-fill-mode.
Accessibility
Keep motion purposeful and provide a reduced-motion experience for people who request it.
@media (prefers-reduced-motion: reduce) {
.notice { animation: none; }
}
Practice
Animate a notification entering the screen without making essential content depend on the animation.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses