Skip to content
easeweb
Search topics

Animated headings split into single letters

A hero heading animated letter by letter is built from one inline-block element per letter, so Chrome gives screen readers the letters, not the words.

WCAG 2.2
SC 1.3.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <span class="char">P</span>
The accessibility problem illustrated: No vision:What does the heading say?
01

The problem

Screen reader users get an animated heading as a run of single letters, with nothing to show where one word ends, so the page's main message is spelled out to them

02

Try it

Compare the heading on screen with what a screen reader is given for it

Turn on “Show the boxes” to outline each box the animation moves. Under the page is the heading as Chrome passes it on, and as the headings list shows it. Then apply each fix: does the heading still rise, and does a screen reader get words?

Broken Can you fix this?

BrokenA heading split into letter boxes

Plan your week in minutes

One calendar for work, school runs and everything between.

Screen reader says:

heading, P l a n y o u r w e e k i n m i n u t e s

Its list of headings:

  1. P l a n y o u r w e e k i n m i n u t e s

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give screen readers words, and animate what they skip

Before
BrokenA heading split into letter boxes
<section class="hero">  <h1 class="hero-title">    <span class="word">      <span class="char" style="--char-index: 0">P</span>      <span class="char" style="--char-index: 1">l</span>      <span class="char" style="--char-index: 2">a</span>      <span class="char" style="--char-index: 3">n</span>    </span>    <span class="word">      <span class="char" style="--char-index: 4">y</span>      …    </span>    …  </h1></section>
What is wrong3 points
  • Each letter is an inline-block element of its own.
  • So Chrome names the heading "P l a n y o u r w e e k i n m i n u t e s", with no break between the words.
  • The headings list, and anything else that reads the heading's text, gets the same run of letters.
After

Words for screen readers, letters hidden

<section class="hero">  <h1 class="hero-title">    <span class="visually-hidden">Plan your week in minutes</span>    <span class="letters" aria-hidden="true">      <span class="word">        <span class="char" style="--char-index: 0">P</span>        <span class="char" style="--char-index: 1">l</span>        <span class="char" style="--char-index: 2">a</span>        <span class="char" style="--char-index: 3">n</span>      </span>      <span class="word">        <span class="char" style="--char-index: 4">y</span>        …      </span>      …    </span>  </h1></section>
How it is fixed2 steps
  1. Put the words in the heading once, as text that is hidden on screen but kept for screen readers. The heading is now named "Plan your week in minutes".
  2. Wrap the letters in an element with aria-hidden="true", and split only that element. Screen readers skip the letters, so the words are read once.

This fixes the Before and passes 1.3.2, on any element: a heading, a link, a paragraph. The animation is unchanged. The words are written twice, so keep the hidden copy and the letters built from the same string.

04

Verify the fix

3 checks, no mouse.

Test with: Screen reader

0 of 3 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the animation or its library changes.

Limits

This is a starting pattern, not a guarantee for every application. It covers a heading split by a script into letters for an animation, and was checked in Chrome's accessibility tree; other browsers build their trees in their own way, and no screen reader was tested for this guide. Whether a screen reader spells the letters, reads them as sounds, or joins some of them depends on the screen reader, its settings and its speech engine. Text split into lines, for a line-by-line reveal, keeps its words and is not covered here.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service