Code Fix Guide

How to Fix CSS Text Spacing for Accessibility

WCAG 1.4.12 requires that content doesn't break when users override text spacing properties. Many websites use fixed-height containers, overflow:hidden, or absolute positioning that clips text when spacing is increased — making content unreadable for users with dyslexia and other reading disabilities.

Common Errors and How to Fix Them

Fixed height container clips text when spacing increases
Problem
.card {
  height: 200px;
  overflow: hidden;
}
Fix
.card {
  min-height: 200px; /* Use min-height instead */
  /* Remove overflow: hidden on text containers */
}
Button with fixed height breaks with increased line-height
Problem
.button {
  height: 40px;
  line-height: 40px;
  overflow: hidden;
}
Fix
.button {
  padding: 8px 16px;
  /* Let height be determined by content + padding */
  /* No fixed height or line-height needed */
}

Why This Matters

Text spacing issues violate WCAG 1.4.12 (Text Spacing). Users must be able to override: line-height to 1.5x font size, paragraph spacing to 2x font size, letter-spacing to 0.12em, and word-spacing to 0.16em — without loss of content. Use flexible CSS layouts with min-height, padding, and relative units.

Find All Your Accessibility Issues Automatically

ADA CodeFix scans your website for WCAG 2.1 AA violations and generates AI-powered code fixes — not vague descriptions, actual code you can copy-paste.

Scan Your Site Free
No credit card required AI-generated code fixes