Inline text spacing must not block user style overrides
Don't lock letter, word or line spacing with `!important` in a `style` attribute. People who need wider spacing to read override it with their own styles, and inline `!important` defeats them.
| Rule ID | avoid-inline-spacing |
|---|---|
| Impact | Serious |
| Success criterion | 1.4.12 Text Spacing · AA |
| Standards | WCAG 2.1 · WCAG 2.2 · EN 301 549 |
| Fixed automatically |
Example
<p style="line-height: 1.2 !important; letter-spacing: 0 !important;">
Your booking includes breakfast, free Wi-Fi and late checkout until 2 pm.
</p>A reader with dyslexia turns on wider spacing in their browser extension; this paragraph stays cramped.
<p style="line-height: 1.2; letter-spacing: 0;">
Your booking includes breakfast, free Wi-Fi and late checkout until 2 pm.
</p>The reader's spacing settings take effect and the paragraph opens up like the rest of the page.
Why it matters
Many people read more easily when there is more space between lines, words and letters. This includes people with dyslexia, low vision and some cognitive disabilities. They use browser extensions, bookmarklets or user stylesheets to widen the spacing on every site they visit.
WCAG 1.4.12 requires that content keeps working when users set line height to 1.5 times the font size, paragraph spacing to 2 times, letter spacing to 0.12 times and word spacing to 0.16 times. An inline style marked !important has the highest priority among the page's own styles, and most of these tools cannot override it. The text stays tight exactly where the reader needs it to open up.
How to fix it
Find inline style attributes that set spacing with !important, often added by page builders, email-style templates or a quick fix in a CMS.
Remove !important. In most cases the inline value alone does the job:
<p style="line-height: 1.2;">Your booking includes breakfast.</p>
Better: move the style to your stylesheet. Class-based rules are easier to maintain and easy for users to override:
<style>
.booking-note { line-height: 1.5; }
</style>
<p class="booking-note">Your booking includes breakfast.</p>
You need !important to beat a theme. Then use values at or above the WCAG amounts, so nobody needs to widen them: letter-spacing: 0.12em, word-spacing: 0.16em, and line-height: 1.5 for text that wraps.
Also avoid fixed heights and overflow: hidden on text containers. When users add spacing, the text grows, and a fixed box would cut it off. Test by applying wider spacing with a text-spacing bookmarklet and checking that nothing overlaps or disappears.
Checklist
- Remove !important from inline letter, word and line spacing.
- Move spacing styles into your stylesheet.
- Use values at or above the WCAG minimums when !important is unavoidable.
- Test the page with increased text spacing.
How the check works
The check looks at visible elements with a style attribute. It fails when that attribute sets letter-spacing, word-spacing or line-height with !important to a value below the WCAG amounts: 0.12em for letters, 0.16em for words, and 1.5 for line height (counted only for text that wraps onto several lines). Values at or above these pass. Spacing locked in stylesheets is not covered, so test that by widening the spacing yourself.
Resources
- Understanding 1.4.12 Text Spacing W3C
- W3C ACT rule 24afc2 W3C ACT
- W3C ACT rule 9e45ec W3C ACT
- W3C ACT rule 78fd32 W3C ACT
- Designing for web accessibility: tips W3C WAI
Updated October 27, 2026