Skip to content
easeweb
Search topics

Button labels cut off when people widen text spacing

Buttons with a fixed height, a single line and hidden overflow can't make room for a label that wider spacing makes longer, so the label is cut short.

WCAG 2.2
SC 1.4.12AA· new in 2.1
Required by
EN 301 549 (EU)
Broken height: 44px
The accessibility problem illustrated: Cognitive:Add to what?
01

The problem

People who widen letter and word spacing to read more easily can't read button labels that a fixed-size button cuts short

02

Try it

Widen the text spacing and read the buttons

Turn on Text spacing: line height 1.5, letter spacing 0.12em, word spacing 0.16em and paragraph spacing 2em. Can you still read both buttons in full?

Simulate Text spacing

Broken Can you fix this?

BrokenButtons with a fixed size and one line

Cast iron skillet, 26 cm

49.00

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Let every button grow when its label grows

Before
BrokenButtons with a fixed size and one line
<div class="buy-row">  <button type="submit" class="button">    <span class="button-label">Add to basket</span>  </button>  <button type="button" class="button button-secondary">    <span class="button-label">Buy it now</span>  </button></div>
What is wrong3 points
  • With the 1.4.12 spacing the labels are cut off: each label is wider than its half of the row.
  • The button can't make room for it: it has a fixed height and its label is held on one line, so it can't grow in any direction.
  • Readers lose the end of the label: it is hidden behind an ellipsis.
After

Let the label wrap

<div class="buy-row">  <button type="submit" class="button">    <span class="button-label">Add to basket</span>  </button>  <button type="button" class="button button-secondary">    <span class="button-label">Buy it now</span>  </button></div>
How it is fixed2 steps
  1. Change height to min-height, and centre the label with padding instead of line height. At the shop's own spacing the buttons look as before: one line each, 44 pixels tall.
  2. Remove the .button-label rule, with its nowrap, overflow and ellipsis. With wider spacing, a label that no longer fits wraps onto a second line and the button grows taller to hold it.

This fixes the Before and passes 1.4.12. The buttons stay side by side and the HTML doesn't change.

HTML and ARIA
04

Verify the fix

5 checks, no mouse.

Test with: Text spacing

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the button component or theme changes.

Limits

This is a starting pattern, not a guarantee for every application. 1.4.12 asks only that content survives the four values; it doesn't require a site to offer spacing controls of its own. The Level AAA criterion 1.4.8 asks more of blocks of text, among other things that they are not justified: see justified text with uneven gaps between words. Some content is exempt, such as text in images and captions burned into video. Class names in the snippets are placeholders. Test every template that has controls, not only the product page.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service