CSS Neon Text Animation
Neon sign text built from layered text-shadows, with a short flicker so the tube looks live.

Neon text is a bright core, a tight colored halo, and a wide halo that falls off into the dark. People still search for “css neon text” and “neon sign animation” because a single text-shadow looks like a blurry label, and a real tube sign flickers once and then holds. The flicker is two or three frames of opacity inside a long, otherwise steady animation. Constant strobing is a different effect, and it is hostile to read.
The demo is two words on black. OPEN is magenta. LATE is cyan, letterspaced like a second line on the same sign. Both flicker on different periods so they do not blink in unison.
If you want the color to travel through the letters, use the gradient text animation. If you want the letters to jump, use the wavy text. Neon stays still and glows.
The glow stack
Four shadows, inside out:
h1 {
color: #fff;
text-shadow:
0 0 6px #fff,
0 0 16px #f0abfc,
0 0 36px #e879f9,
0 0 72px #c026d3;
}
The first shadow is white and tight. That is the tube. The next two are the gas color. The last is the spill on the wall, and it should be the most saturated and the most transparent-looking, which a large blur gives you for free. Put this on near-black. Neon on white has nowhere for the spill to land, so it reads as a fuzzy bold weight.
letter-spacing on the second line sells the sign. Real neon letters are built on a grid with air between them. Tight tracking looks like a heading that happens to be pink.
The flicker
@keyframes flicker {
0%, 18%, 22%, 56%, 100% { opacity: 1; }
20% { opacity: 0.45; }
21% { opacity: 1; }
54% { opacity: 0.7; }
55% { opacity: 0.35; }
}
h1 { animation: flicker 4.2s infinite; }
Most of the 4.2 seconds is full opacity. The dips are one or two percent of the timeline, back to back, which reads as a ballast failing and catching. Run the second line on a longer duration with a delay so the sign feels like two circuits.
Do not animate text-shadow blur from 0 to 80 every second. That repaints a large glow and it pulses like an alarm.
Readability
The words are the content. “OPEN LATE” is the accessible name of the sign. The glow is paint. If the only copy on the hero is the neon word, it must be real text, which it is here: an h1 and a paragraph.
White letters with a colored shadow remain readable when the animation is paused. Check the paused state, because reduced motion will leave you there. Magenta text with no white core, on black, can pass as an effect and fail as a word. The white color is doing the contrast work. The shadows are extra.
When it is the wrong effect
Trust pages, forms, and anything a person stares at for more than a few seconds. A neon headline on a campaign or a poster frame is the right dose. A neon body paragraph is a fog. One sign per view.
Questions about neon text
How do I make neon text in CSS?
Set the text color to white and stack four text-shadows: a tight white core, two colored halos, and one wide spill. Put the type on a near-black background so the spill is visible.
How do I animate a neon sign flicker?
Animate opacity, not the shadow. Hold opacity at 1 for most of a 4–6 second loop, and drop it for a frame or two in the middle. Offset a second line with animation-delay so both tubes do not blink together.
Is neon text bad for accessibility?
The flicker is, if it runs without a reduced-motion escape. The color can be fine when the core of the letter is light and the background is dark. Pause the animation under prefers-reduced-motion: reduce and keep the white core.