Text Animations in CSS
From the CSS Animations cheat sheet · Practical Examples · verified Jul 2026
Text Animations
Animate text for emphasis and visual interest
css
/* Typewriter Effect */
.typewriter {
overflow: hidden;
white-space: nowrap;
animation: typing 3s steps(30), blink 0.5s step-end infinite alternate;
}
@keyframes typing {
from { width: 0; }
to { width: 100%; }
}
@keyframes blink {
50% { border-color: transparent; }
}
/* Gradient Animation */
.gradient-text {
background: linear-gradient(45deg, #4CAF50, #2196F3, #9C27B0);
background-size: 200%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: gradient 3s ease infinite;
}
@keyframes gradient {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}💡 Animate individual letters for typewriter effects
⚡ Use clip-path for reveal animations
📌 Text shadows for glowing effects
⚠️ Ensure text remains readable during animation