Structure
Text spacing must not be locked with !important
- Rule:
avoid-inline-spacing - Severity: Serious
- WCAG level AA
Why it matters
People with dyslexia or low vision widen line height and letter spacing to read. Inline styles marked !important cannot be overridden by their stylesheet, so the page stays unreadable for them.
How to fix it
- Remove !important from inline line-height, letter-spacing and word-spacing.
- Move the spacing into a stylesheet, where a user style can win.
- Test that the text still reflows at 1.5x line height and 0.12em letter spacing without clipping.
In markup
<p style="line-height: 1.1 !important">...</p><p style="line-height: 1.1">...</p>The requirement behind it
This rule is one way of failing the following WCAG 2.2 success criteria. The W3C, which writes the standard, explains each of them:
- 1.4.12 Text Spacing (opens in new tab) — WCAG level AA
Further reading
Deque University on avoid-inline-spacing (opens in new tab)
Deque maintains axe-core, the open-source engine our scanner runs. Their page documents the rule as the engine implements it.
Automated checks find failures a browser can prove. They cannot judge whether a caption is accurate, whether an alt text is useful, or whether a page can be operated end to end with a keyboard — those need a person.