Skip to main content
WCAGrules
Quick navigation

Give meaningful font icons role=img

An icon font paints its glyph through a CSS pseudo-element, usually from a private-use character that means nothing outside the font. ARIA24 gives that element role=img, which tells software the thing is an image rather than a stray character, and W3C lists it as sufficient for 1.3.1 Info and Relationships. The role is what W3C's test checks. Whether the icon also needs a name is a separate decision and it is the one that matters in practice. An icon that carries meaning on its own, a status tick, an alert triangle, needs aria-label saying what it means. An icon sitting beside text that already says the same thing is decoration, so hide it with aria-hidden and let the words do the work. The hardest case is the icon-only link, where the icon is the whole of the control and the name has to be there.

How we find it in an audit

This is largely manual, because the glyph lives in CSS rather than in the markup and a scanner sees an empty span. We look at every icon on screen and ask what it is doing. Repeating the text next to it, or carrying information nothing else carries. Then we listen to what each one actually announces.

How affected users experience it

Unmarked icon fonts are the source of the strangest thing screen readers say. A private-use character has no name, so some readers say nothing, some read a description of the code point, and some spell out an unrelated symbol. On a status column where the tick is the only signal, the listener hears a row of noise where the answer should be.

Passes vs. fails

Passes: name, role, and state exposed. Fails: a control with no identity.

Passes

<p>Status: <span class="icon icon-check" role="img" aria-label="Complete"></span></p>

Fails

<p>Status: <span class="icon icon-check"></span></p>

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

Other ways to satisfy this rule

52 guides on this site are filed under 1.3.1 Info and Relationships. W3C lists this one as sufficient for that rule on its own. Implement it correctly, in a way your readers' software actually supports, and the rule is met.

This guide is our interpretation of W3C technique ARIA24: Semantically identifying a font icon with role="img". W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations