Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/text-animations

28 CSS Text Animations

23 Pure CSS5 with JSPublished 2026-10-05Free · no sign-up

Text animations for headlines and hero sections, plus three families that used to have their own pages: typewriter effects with a blinking caret, glitch text and neon glow. The core set: text animations for headlines and hero sections: words that rise from behind a mask, letters moving in a wave, a rotating word, a highlighter sweeping across key phrases, a blur-in entrance, a decoding scramble and outlined letters that fill like rising liquid.

01. Words Rise from Behind a Mask

TextEntrance

Each word slides up from below an invisible line, one after another, a staple of editorial landing pages. Every word sits in an overflow: hidden wrapper, and the heading's full text stays in the DOM in reading order so screen readers hear one sentence.

View code
<h3 class="ta1"><span><i style="--i:0">Design</i></span> <span><i style="--i:1">that</i></span> <span><i style="--i:2">moves</i></span> <span><i style="--i:3">people.</i></span></h3>
.ta1 { margin: 0; color: #f8fafc; font: 800 36px/1.1 Inter, system-ui, sans-serif; text-align: center; }
.ta1 span { display: inline-block; overflow: hidden; vertical-align: top; }
.ta1 i { display: inline-block; font-style: normal; animation: ta1 .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 110ms + .2s); }
@keyframes ta1 { from { transform: translateY(105%); } }
@media (prefers-reduced-motion: reduce) { .ta1 i { animation: none; } }

02. Letters in a Wave

TextLoop

Each letter bobs up and down with a delay based on its position, producing a wave along the word. The letters are split into spans by script, the sentence is repeated once in visually hidden text, and the letter spans are hidden from assistive technology.

View code
<p class="ta2"><span class="sr">Loading your space</span><span class="l" aria-hidden="true">Loading your space</span></p>
.ta2 { margin: 0; color: #4f46e5; font: 800 26px Inter, system-ui, sans-serif; }
.ta2 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ta2 .l span { display: inline-block; white-space: pre; animation: ta2 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * 60ms); }
@keyframes ta2 { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .ta2 .l span { animation: none; } }
var l = document.querySelector('.ta2 .l'), t = l.textContent;
l.textContent = '';
t.split('').forEach(function (c, i) { var s = document.createElement('span'); s.textContent = c; s.style.setProperty('--i', i); l.appendChild(s); });

03. Rotating Word in a Headline

TextRotator

The last word of the headline cycles through designers, developers and founders with a vertical slide. Screen readers get a static version, Built for designers, developers and founders, in a hidden span, because a changing word would be confusing to hear.

View code
<h3 class="ta3"><span class="sr">Built for designers, developers and founders</span><span aria-hidden="true">Built for <span class="box"><span class="list"><b>designers</b><b>developers</b><b>founders</b><b>designers</b></span></span></span></h3>
.ta3 { margin: 0; color: #e2e8f0; font: 800 28px/1.2 Inter, system-ui, sans-serif; text-align: center; }
.ta3 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ta3 .box { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: bottom; }
.ta3 .list { display: flex; flex-direction: column; animation: ta3 6s cubic-bezier(.7,0,.3,1) infinite; }
.ta3 b { color: #fbbf24; }
@keyframes ta3 { 0%, 25% { transform: translateY(0); } 33%, 58% { transform: translateY(-1.2em); } 66%, 91% { transform: translateY(-2.4em); } 100% { transform: translateY(-3.6em); } }
@media (prefers-reduced-motion: reduce) { .ta3 .list { animation: none; } }

04. Highlighter Marker Sweep

TextHighlight

Key words in a sentence get a yellow highlighter stroke that sweeps across them on load, drawn with a background gradient whose size animates from 0 to 100 percent. The words are mark elements, so the emphasis is also semantic.

View code
<p class="ta4">Ship your store in <mark>one weekend</mark>, not <mark>three months</mark>.</p>
.ta4 { width: 300px; max-width: 100%; margin: 0; color: #101828; font: 700 24px/1.4 Inter, system-ui, sans-serif; }
.ta4 mark { color: inherit; background: linear-gradient(transparent 55%, #fde047 55%, #fde047 90%, transparent 90%) left / 0% 100% no-repeat; animation: ta4 .8s ease-out forwards; }
.ta4 mark:nth-of-type(2) { animation-delay: .7s; }
@keyframes ta4 { to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .ta4 mark { animation: none; background-size: 100% 100%; } }

05. Blur-In Headline

TextBlur

The headline starts blurred and slightly spaced out, then sharpens and tightens into place, a soft entrance suited to calm brands. filter: blur and letter-spacing animate once together, and the text is fully readable from the end of the first second.

View code
<h3 class="ta5">Quiet tools for loud ideas</h3>
.ta5 { margin: 0; color: #f1f5f9; font: 800 28px Inter, system-ui, sans-serif; text-align: center; animation: ta5 1.1s ease-out both; }
@keyframes ta5 { from { filter: blur(12px); letter-spacing: .3em; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ta5 { animation: none; } }

06. Text Scramble Decode

TextJavaScript

Random characters resolve into the real text from left to right, like a terminal decoding a message. The final text is in the HTML from the start and the effect only runs on screen; the scrambling copy is aria-hidden and the real words sit in visually hidden text, so nothing garbled is read.

View code
<p class="ta6"><span class="sr">Access granted</span><span class="v" aria-hidden="true">ACCESS GRANTED</span></p>
.ta6 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ta6 { margin: 0; color: #34d399; font: 700 26px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .08em; }
var el = document.querySelector('.ta6 .v'), final = el.textContent, chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#$%&';
if (!matchMedia('(prefers-reduced-motion: reduce)').matches) { var f = 0;
  var id = setInterval(function () { el.textContent = final.split('').map(function (c, i) { return c === ' ' || i < f / 3 ? c : chars[Math.floor(Math.random() * chars.length)]; }).join(''); if (++f > final.length * 3) { clearInterval(id); el.textContent = final; } }, 40); }

07. Outline Text That Fills

TextStroke

Big outlined letters fill with solid colour from bottom to top, like liquid rising. The outline is -webkit-text-stroke, and the fill is a background clipped to the text whose position animates; browsers without text clipping show plain solid text.

View code
<p class="ta7">FLOW</p>
.ta7 { margin: 0; color: #0e7490; font: 900 80px/1 Inter, system-ui, sans-serif; letter-spacing: .04em; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .ta7 { color: transparent; -webkit-text-stroke: 2px #0e7490; background: linear-gradient(#0e7490 0 0) 0 100% / 100% 0% no-repeat; -webkit-background-clip: text; background-clip: text; animation: ta7 2.4s ease-in-out .3s forwards; }
}
@keyframes ta7 { to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .ta7 { animation: none; background-size: 100% 100%; } }

08. Classic Typing with steps()

TypewriterNo JS

The text reveals one character at a time because its width animates in steps() from 0 to the text's length in ch units, and a border on the right blinks as the caret. It needs a monospace font so every character is exactly 1ch wide.

View code
<p class="ty1">npm run build</p>
.ty1 { width: 13ch; margin: 0; overflow: hidden; white-space: nowrap; border-right: 3px solid #4ade80; color: #4ade80; font: 600 24px "JetBrains Mono", ui-monospace, monospace; animation: ty1t 2s steps(13) .4s both, ty1c .75s step-end infinite; }
@keyframes ty1t { from { width: 0; } }
@keyframes ty1c { 50% { border-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .ty1 { animation: none; } }

09. Two Lines Typed in Turn

TypewriterSequence

The second line starts typing only after the first has finished, using an animation delay equal to the first line's duration. The caret moves with the typing because only the line currently being typed shows it.

View code
<div class="ty2"><p class="a">Hello, I'm Sam.</p><p class="b">I build fast shops.</p></div>
.ty2 { font: 600 22px "JetBrains Mono", ui-monospace, monospace; color: #101828; }
.ty2 p { width: 0; margin: 0 0 6px; overflow: hidden; white-space: nowrap; border-right: 3px solid transparent; }
.ty2 .a { animation: ty2a 1.5s steps(15) .3s forwards, ty2on 1.8s step-end; }
.ty2 .b { color: #7c3aed; animation: ty2b 1.9s steps(19) 2s forwards, ty2c .7s step-end 2s infinite; }
@keyframes ty2a { to { width: 15ch; } }
@keyframes ty2b { to { width: 19ch; } }
@keyframes ty2on { 0%, 99% { border-color: currentColor; } }
@keyframes ty2c { 0%, 49% { border-color: currentColor; } }
@media (prefers-reduced-motion: reduce) { .ty2 .a { width: 15ch; animation: none; } .ty2 .b { width: 19ch; animation: none; } }

10. Type, Delete and Loop Words

TypewriterJavaScript

A headline types a word, pauses, deletes it and types the next, in a loop. Screen readers get one static sentence listing every word, and the moving part is aria-hidden, because a constantly changing word would be read over and over.

View code
<h3 class="ty3"><span class="sr">We design websites, online shops and mobile apps.</span><span aria-hidden="true">We design <span class="w"></span><span class="c">|</span></span></h3>
.ty3 { margin: 0; color: #f8fafc; font: 800 26px Inter, system-ui, sans-serif; }
.ty3 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ty3 .w { color: #38bdf8; }
.ty3 .c { color: #38bdf8; font-weight: 400; animation: ty3 .8s step-end infinite; }
@keyframes ty3 { 50% { opacity: 0; } }
var el = document.querySelector('.ty3 .w'), words = ['websites', 'online shops', 'mobile apps'], i = 0, n = 0, del = false;
if (matchMedia('(prefers-reduced-motion: reduce)').matches) { el.textContent = words[0]; } else (function tick() {
  var w = words[i]; n += del ? -1 : 1; el.textContent = w.slice(0, n);
  var wait = del ? 50 : 100;
  if (!del && n === w.length) { del = true; wait = 1400; } else if (del && n === 0) { del = false; i = (i + 1) % words.length; wait = 300; }
  setTimeout(tick, wait);
})();

11. Terminal Command and Output

TypewriterTerminal

A command is typed at the prompt, then its output lines appear one by one, like a real terminal session. The typing uses steps() and the output lines fade in with delays that start after the typing ends.

View code
<div class="ty4"><p class="cmd"><span class="pr">$</span> <span class="t">git push origin main</span></p><p class="o" style="--d:2.4s">Enumerating objects: 12, done.</p><p class="o" style="--d:2.8s">Writing objects: 100% (7/7)</p><p class="o ok" style="--d:3.2s">main -&gt; main</p></div>
.ty4 { width: 300px; max-width: 100%; padding: 14px; box-sizing: border-box; border-radius: 12px; background: #0b1020; font: 500 13px/1.7 "JetBrains Mono", ui-monospace, monospace; color: #cbd5e1; }
.ty4 p { margin: 0; }
.ty4 .pr { color: #a78bfa; }
.ty4 .t { display: inline-block; width: 0; vertical-align: bottom; overflow: hidden; white-space: nowrap; color: #f8fafc; animation: ty4 2s steps(20) .3s forwards; }
.ty4 .o { opacity: 0; animation: ty4o .01s var(--d) forwards; }
.ty4 .ok { color: #4ade80; }
@keyframes ty4 { to { width: 20ch; } }
@keyframes ty4o { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ty4 .t { width: 20ch; animation: none; } .ty4 .o { opacity: 1; animation: none; } }

12. Blinking Caret After a Heading

TypewriterCaret

No typing at all, just a block caret blinking after a finished heading, which gives a code-themed brand a hint of a terminal without making anyone wait to read. The caret is a decorative pseudo-element.

View code
<h3 class="ty5">build something small</h3>
.ty5 { margin: 0; color: #101828; font: 700 26px "JetBrains Mono", ui-monospace, monospace; }
.ty5::after { content: ""; display: inline-block; width: .55em; height: 1em; margin-left: 4px; vertical-align: -.12em; background: #7c3aed; animation: ty5 1s step-end infinite; }
@keyframes ty5 { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ty5::after { animation: none; } }

13. Typo, Delete and Correct

TypewriterJavaScript

The line types a wrong word, pauses, deletes it and types the right one, a human touch for a hero or a cover letter site. A small script plays a list of type and delete steps; the finished sentence is in the HTML for screen readers and no-script visitors.

View code
<p class="ty6"><span class="sr">Websites that feel fast.</span><span class="v" aria-hidden="true">Websites that feel fast.</span></p>
.ty6 { margin: 0; color: #101828; font: 700 24px "JetBrains Mono", ui-monospace, monospace; }
.ty6 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ty6 .v::after { content: "▍"; color: #e11d48; animation: ty6 .8s step-end infinite; }
@keyframes ty6 { 50% { opacity: 0; } }
var v = document.querySelector('.ty6 .v');
if (!matchMedia('(prefers-reduced-motion: reduce)').matches) {
  var steps = [['t', 'Websites that feel slow'], ['w', 600], ['d', 4], ['t', 'fast.']], out = '', k = 0;
  v.textContent = '';
  (function run() {
    var s = steps[k]; if (!s) return;
    if (s[0] === 'w') { k++; setTimeout(run, s[1]); return; }
    if (s[0] === 't') { if (s.n === undefined) s.n = 0; out += s[1][s.n++]; v.textContent = out; if (s.n >= s[1].length) k++; return setTimeout(run, 70); }
    if (s[0] === 'd') { if (s.n === undefined) s.n = s[1]; out = out.slice(0, -1); v.textContent = out; if (--s.n <= 0) k++; return setTimeout(run, 60); }
  })();
}

14. Typing Indicator Then Message

TypewriterChat

A chat bubble shows three bouncing dots while the other person types, then the message replaces them. The dots are aria-hidden with a visually hidden Typing label, and the final message lands in a polite live region so it is announced.

View code
<div class="ty7" aria-live="polite"><div class="b typing"><span class="sr">Support is typing</span><i aria-hidden="true"></i><i aria-hidden="true"></i><i aria-hidden="true"></i></div></div>
.ty7 { width: 260px; max-width: 100%; font: 15px Inter, system-ui, sans-serif; }
.ty7 .b { display: inline-flex; gap: 5px; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: #1e293b; color: #e2e8f0; line-height: 1.4; }
.ty7 i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; animation: ty7 1.2s ease-in-out infinite; }
.ty7 i:nth-of-type(2) { animation-delay: .15s; } .ty7 i:nth-of-type(3) { animation-delay: .3s; }
.ty7 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes ty7 { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ty7 i { animation: none; } }
var w = document.querySelector('.ty7');
setTimeout(function () { w.innerHTML = '<div class="b">Hi! Your order shipped this morning.</div>'; }, 2600);

15. RGB Split Glitch

GlitchText

Two copies of the text in cyan and magenta jitter sideways behind the real one, clipped to thin slices that jump around. The copies come from attr(data-text) in pseudo-elements, so the word appears once in the DOM and is read once.

View code
<p class="gl1" data-text="SIGNAL">SIGNAL</p>
.gl1 { position: relative; margin: 0; color: #f8fafc; font: 900 56px Inter, system-ui, sans-serif; letter-spacing: .06em; }
.gl1::before, .gl1::after { content: attr(data-text); position: absolute; inset: 0; }
.gl1::before { color: #22d3ee; transform: translateX(-3px); clip-path: inset(10% 0 60% 0); animation: gl1a 2.6s steps(1) infinite; mix-blend-mode: screen; }
.gl1::after { color: #f0f; transform: translateX(3px); clip-path: inset(55% 0 15% 0); animation: gl1b 3.1s steps(1) infinite; mix-blend-mode: screen; }
@keyframes gl1a { 0% { clip-path: inset(10% 0 60% 0); } 20% { clip-path: inset(70% 0 5% 0); } 40% { clip-path: inset(30% 0 45% 0); } 60% { clip-path: inset(0 0 85% 0); } 80% { clip-path: inset(50% 0 30% 0); } }
@keyframes gl1b { 0% { clip-path: inset(55% 0 15% 0); } 25% { clip-path: inset(5% 0 75% 0); } 50% { clip-path: inset(40% 0 40% 0); } 75% { clip-path: inset(80% 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .gl1::before, .gl1::after { animation: none; } }

16. Glitch Only on Hover

GlitchHover

A link that is perfectly calm until it is hovered or focused, then glitches for a fraction of a second with shifted colour copies. Running the effect only on interaction keeps the page readable and turns the glitch into feedback.

View code
<a class="gl2" href="#enter" data-text="Enter the site">Enter the site</a>
.gl2 { position: relative; display: inline-block; color: #e2e8f0; font: 800 26px Inter, system-ui, sans-serif; text-decoration: none; }
.gl2::before, .gl2::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.gl2::before { color: #22d3ee; } .gl2::after { color: #f472b6; }
.gl2:hover::before, .gl2:focus-visible::before { opacity: .8; animation: gl2 .35s steps(2) 2; }
.gl2:hover::after, .gl2:focus-visible::after { opacity: .8; animation: gl2 .35s steps(2) 2 reverse; }
@keyframes gl2 { 0% { transform: translate(-3px, 1px); clip-path: inset(0 0 60% 0); } 50% { transform: translate(3px, -1px); clip-path: inset(40% 0 0 0); } 100% { transform: translate(0); clip-path: inset(0); opacity: 0; } }
.gl2:focus-visible { outline: 2px solid #22d3ee; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .gl2::before, .gl2::after { display: none; } }

17. CRT Scanlines with Flicker

GlitchRetro

Green terminal text behind horizontal scanlines and a faint flicker, the look of an old CRT monitor. The scanlines are a repeating linear gradient in a pseudo-element, and the flicker is a small opacity change well below anything that could count as flashing.

View code
<div class="gl3"><p>&gt; booting studio_os<br>&gt; loading assets ... ok<br>&gt; ready_</p></div>
.gl3 { position: relative; width: 280px; max-width: 100%; padding: 18px; box-sizing: border-box; border-radius: 14px; background: radial-gradient(ellipse at center, #062b17, #020a05); overflow: hidden; animation: gl3 4s infinite; }
.gl3::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.35) 2px 4px); pointer-events: none; }
.gl3 p { margin: 0; color: #4ade80; font: 500 15px/1.7 "JetBrains Mono", ui-monospace, monospace; text-shadow: 0 0 6px rgba(74,222,128,.7); }
@keyframes gl3 { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .9; } 96% { opacity: .96; } }
@media (prefers-reduced-motion: reduce) { .gl3 { animation: none; } }

18. Slice Shift Glitch

GlitchClip-path

Horizontal slices of the word slide sideways by different amounts for a few frames, then snap back. Three stacked copies each show one slice through clip-path and share a stepped animation, while the original word stays as the readable layer.

View code
<p class="gl4"><span class="t">ERROR</span><span class="s s1" aria-hidden="true">ERROR</span><span class="s s2" aria-hidden="true">ERROR</span></p>
.gl4 { position: relative; display: inline-grid; margin: 0; font: 900 60px Inter, system-ui, sans-serif; color: #101828; }
.gl4 span { grid-area: 1 / 1; }
.gl4 .s { color: #dc2626; }
.gl4 .s1 { clip-path: inset(20% 0 55% 0); animation: gl4 2.8s steps(1) infinite; }
.gl4 .s2 { clip-path: inset(62% 0 18% 0); animation: gl4 2.8s steps(1) infinite reverse; }
@keyframes gl4 { 0%, 80%, 100% { transform: none; opacity: 0; } 82% { transform: translateX(-8px); opacity: 1; } 86% { transform: translateX(6px); opacity: 1; } 90% { transform: translateX(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gl4 .s { display: none; } }

19. Skew Jitter

GlitchTransform

The whole word skews and shifts sharply for a moment every few seconds, like a dropped video frame. It uses steps(1) so each keyframe holds without easing, which gives the hard, digital feel that smooth easing would soften.

View code
<p class="gl5">NO SIGNAL</p>
.gl5 { margin: 0; color: #fde047; font: 900 44px Inter, system-ui, sans-serif; letter-spacing: .05em; animation: gl5 3s steps(1) infinite; }
@keyframes gl5 { 0%, 88%, 100% { transform: none; } 90% { transform: skewX(18deg) translateX(-6px); } 93% { transform: skewX(-10deg) translateX(4px); } 96% { transform: none; } 97% { transform: skewX(6deg); } }
@media (prefers-reduced-motion: reduce) { .gl5 { animation: none; } }

20. Colour Noise Shadow

GlitchShadow

Red and blue text-shadows wobble around the word at slightly different rates, creating chromatic noise without any extra elements. The offsets are only a few pixels so the word stays perfectly readable.

View code
<p class="gl6">Static</p>
.gl6 { margin: 0; color: #f8fafc; font: 900 54px Inter, system-ui, sans-serif; animation: gl6 1.6s steps(4) infinite; }
@keyframes gl6 { 0% { text-shadow: 2px 0 #ef4444, -2px 0 #3b82f6; } 25% { text-shadow: -1px 1px #ef4444, 2px -1px #3b82f6; } 50% { text-shadow: 3px -1px #ef4444, -1px 1px #3b82f6; } 75% { text-shadow: -2px 0 #ef4444, 1px 1px #3b82f6; } 100% { text-shadow: 2px 0 #ef4444, -2px 0 #3b82f6; } }
@media (prefers-reduced-motion: reduce) { .gl6 { animation: none; text-shadow: 2px 0 #ef4444, -2px 0 #3b82f6; } }

21. Glitchy 404 Block

Glitch404

A not-found message with a glitching 404, a plain-language explanation and a link home. The glitch is decoration on the number only; the heading text, the help and the link carry everything a visitor needs.

View code
<section class="gl7"><h3><span class="n" data-text="404" aria-hidden="true">404</span><span class="sr">Error 404:</span> Page not found</h3><p>The page may have moved. Try the home page or search.</p><a href="#home">Go to the home page</a></section>
.gl7 { width: 280px; max-width: 100%; text-align: center; font-family: Inter, system-ui, sans-serif; }
.gl7 h3 { display: grid; gap: 4px; margin: 0 0 8px; color: #e2e8f0; font-size: 18px; }
.gl7 .n { position: relative; color: #fff; font-size: 80px; font-weight: 900; line-height: 1; }
.gl7 .n::before, .gl7 .n::after { content: attr(data-text); position: absolute; inset: 0; }
.gl7 .n::before { color: #22d3ee; clip-path: inset(0 0 65% 0); animation: gl7 2.4s steps(1) infinite; }
.gl7 .n::after { color: #f472b6; clip-path: inset(60% 0 0 0); animation: gl7 2.4s steps(1) infinite reverse; }
.gl7 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gl7 p { margin: 0 0 14px; color: #94a3b8; font-size: 14px; }
.gl7 a { display: inline-block; padding: 10px 16px; border-radius: 8px; background: #f8fafc; color: #0f172a; font-weight: 700; font-size: 14px; text-decoration: none; }
.gl7 a:focus-visible { outline: 3px solid #22d3ee; outline-offset: 2px; }
@keyframes gl7 { 0%, 85%, 100% { transform: none; } 87% { transform: translateX(-5px); } 91% { transform: translateX(4px); } 95% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .gl7 .n::before, .gl7 .n::after { animation: none; display: none; } }

22. Flickering Neon Sign

NeonFlicker

A pink neon sign that occasionally stutters, like a tube on its way out. Stacked text-shadows build the glow, and the flicker drops the shadows for a few irregular frames in a long loop. Under reduced motion the sign stays lit and steady.

View code
<p class="nt1">Open late</p>
.nt1 { margin: 0; color: #fff0f8; font: 700 46px "Brush Script MT", "Segoe Script", cursive; text-shadow: 0 0 4px #fff, 0 0 10px #ff4fb4, 0 0 22px #ff4fb4, 0 0 44px #e11d8a, 0 0 80px #e11d8a; animation: nt1 6s infinite; }
@keyframes nt1 { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: .45; text-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .nt1 { animation: none; } }

23. Two-Colour Neon

NeonColour

Two words in two tube colours, cyan and violet, side by side on a brick-dark wall. Each word has its own shadow stack in its own colour, which is all a second neon colour needs.

View code
<p class="nt2"><span class="a">Night</span> <span class="b">Market</span></p>
.nt2 { margin: 0; padding: 18px 22px; border-radius: 12px; background: #120d14; font: 800 38px Inter, system-ui, sans-serif; letter-spacing: .04em; }
.nt2 .a { color: #e0fbff; text-shadow: 0 0 4px #fff, 0 0 12px #22d3ee, 0 0 28px #0891b2, 0 0 50px #0891b2; }
.nt2 .b { color: #f3e8ff; text-shadow: 0 0 4px #fff, 0 0 12px #a855f7, 0 0 28px #7e22ce, 0 0 50px #7e22ce; }

24. Outlined Neon Tube

NeonStroke

Hollow letters with a glowing outline, closer to a real bent-glass tube than a filled glow. The outline is -webkit-text-stroke, the fill is transparent, and drop-shadow filters glow around the stroke rather than a solid shape.

View code
<p class="nt3">ARCADE</p>
.nt3 { margin: 0; color: #a7f3d0; font: 900 52px Inter, system-ui, sans-serif; letter-spacing: .08em; }
@supports (-webkit-text-stroke: 1px #fff) { .nt3 { color: transparent; -webkit-text-stroke: 2px #6ee7b7; filter: drop-shadow(0 0 4px #34d399) drop-shadow(0 0 12px #059669); } }

25. Neon That Lights Up on Hover

NeonHover

A link that looks like an unlit tube at rest and switches on with a quick buzz when hovered or focused. The off state is a dim colour with no shadow; the on state adds the glow with a stepped animation that mimics the start-up flicker.

View code
<a class="nt4" href="#menu">Late menu</a>
.nt4 { color: #6b4a1f; font: 800 42px Inter, system-ui, sans-serif; text-decoration: none; transition: color .1s; }
.nt4:hover, .nt4:focus-visible { color: #fff7e6; text-shadow: 0 0 4px #fff, 0 0 12px #fbbf24, 0 0 28px #f59e0b, 0 0 50px #d97706; animation: nt4 .5s steps(1) both; }
@keyframes nt4 { 0% { opacity: .3; } 15% { opacity: 1; } 30% { opacity: .4; } 45%, 100% { opacity: 1; } }
.nt4:focus-visible { outline: 2px solid #fbbf24; outline-offset: 6px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .nt4:hover, .nt4:focus-visible { animation: none; } }

26. One Letter on the Blink

NeonDetail

Everything is steady except one letter, which blinks out now and then, the detail that makes a neon sign believable. That letter is wrapped in a span with its own flicker animation, and the word still reads as one word.

View code
<p class="nt5">HOT<span>E</span>L</p>
.nt5 { margin: 0; color: #ffe4e6; font: 900 50px Inter, system-ui, sans-serif; letter-spacing: .14em; text-shadow: 0 0 4px #fff, 0 0 12px #fb7185, 0 0 26px #e11d48, 0 0 48px #be123c; }
.nt5 span { animation: nt5 4s infinite; }
@keyframes nt5 { 0%, 40%, 44%, 47%, 100% { opacity: 1; } 42%, 45.5% { opacity: .15; text-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .nt5 span { animation: none; } }

27. Breathing Neon Glow

NeonPulse

Instead of flickering, the glow slowly swells and settles like the tube is breathing, a calmer neon for a sign-up banner. Only text-shadow blur radii change between two keyframes, on a three-second ease-in-out loop.

View code
<p class="nt6">Join the club</p>
.nt6 { margin: 0; color: #ecfeff; font: 800 40px Inter, system-ui, sans-serif; text-shadow: 0 0 3px #fff, 0 0 8px #06b6d4, 0 0 18px #0891b2; animation: nt6 3s ease-in-out infinite alternate; }
@keyframes nt6 { to { text-shadow: 0 0 4px #fff, 0 0 14px #22d3ee, 0 0 34px #06b6d4, 0 0 64px #0e7490; } }
@media (prefers-reduced-motion: reduce) { .nt6 { animation: none; } }

28. Neon Menu Board

NeonLayout

A small neon sign layout: a title in pink tube lettering inside a glowing frame and a plain list of items below, which stays readable because only the title glows. The frame is a border plus inset and outset box-shadows in the same colour.

View code
<section class="nt7"><h3>Noodle Bar</h3><ul><li>Shoyu ramen <b>9</b></li><li>Miso ramen <b>10</b></li><li>Gyoza <b>6</b></li></ul></section>
.nt7 { width: 240px; max-width: 100%; box-sizing: border-box; padding: 18px; border: 2px solid #f9a8d4; border-radius: 16px; background: #120a12; box-shadow: 0 0 10px #ec4899, inset 0 0 10px #ec4899; font-family: Inter, system-ui, sans-serif; }
.nt7 h3 { margin: 0 0 12px; color: #fdf2f8; font-size: 28px; text-align: center; text-shadow: 0 0 4px #fff, 0 0 10px #f472b6, 0 0 24px #db2777; }
.nt7 ul { margin: 0; padding: 0; list-style: none; color: #e5e7eb; font-size: 15px; line-height: 2; }
.nt7 li { display: flex; justify-content: space-between; border-bottom: 1px dashed #4a2340; }
.nt7 b { color: #fbcfe8; }

About these CSS Text Animations

Keep the text readable to everyone

Splitting a word into letter spans can make screen readers spell it out. Hide the split copy with aria-hidden and keep one plain copy of the sentence, visually hidden if necessary.

Masks for reveals

Wrap each word in an inline-block with overflow: hidden and slide the word up from 100 percent. The wrapper hides it until it rises, with no clip-path needed.

Changing words need a static version

A rotating word is fine to look at but confusing to hear. Give assistive technology a complete sentence that lists all the options, and hide the animated version from it.

Animate once, then rest

Text that keeps moving is hard to read. Run entrance effects once, keep loops for small decorative words, and stop everything under prefers-reduced-motion.

Frequently asked questions

Do text animations hurt SEO?

Not when the real text is in the HTML, which it is in every demo.

Why are some letters wrapped by JavaScript?

Splitting by hand is tedious; the script splits the text and adds an index for the stagger. The original text stays readable.

Can I use web fonts with these?

Yes. Load the font first to avoid the animation running on fallback text.