Rampsight

All rules

Structure

Text spacing must not be locked with !important

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

  1. Remove !important from inline line-height, letter-spacing and word-spacing.
  2. Move the spacing into a stylesheet, where a user style can win.
  3. Test that the text still reflows at 1.5x line height and 0.12em letter spacing without clipping.

In markup

Fails
<p style="line-height: 1.1 !important">...</p>
Passes
<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:

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.