Skip to content
easeweb
Search topics

Tap targets too small and too close together

A pointer target needs at least 24 by 24 pixels, or enough space that a 24-pixel circle around it touches nothing else. These icon buttons have neither.

WCAG 2.2
SC 2.5.8AA· new in 2.2
Required by
Not required by Section 508 or EN 301 549
Broken width: 16px; height: 16px
The accessibility problem illustrated: Reach, strength:I hit the wrong button again.
01

The problem

People with tremors, large fingers or an imprecise pointer press the wrong button, or miss it

02

Try it

Raise the quantity to 5 by tapping plus

Try it on a phone, or turn on Show target areas. Dashed circles that overlap mean a slip can press the neighbour, like remove.

Simulate Show target areas

Broken Can you fix this?

Broken16-pixel buttons, 2 pixels apart
Linen napkins Qty 2

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Give every tap target at least 24 pixels of room

Before
Broken16-pixel buttons, 2 pixels apart
<div class="line-actions">  <button type="button" aria-label="Decrease quantity">−</button>  <button type="button" aria-label="Increase quantity">+</button>  <button type="button" aria-label="Remove Linen napkins">×</button></div>
What is wrong3 points
  • The buttons are hard to hit. Each target is 16 by 16 pixels, below the 24-pixel minimum.
  • A slip presses the neighbour, such as remove. The centres are only 18 pixels apart, where the spacing route needs 24, so a 24-pixel circle around each button overlaps its neighbour's circle.
  • The row fails both the size and the spacing route.
After

Bigger buttons

<div class="line-actions">  <button type="button" aria-label="Decrease quantity">−</button>  <button type="button" aria-label="Increase quantity">+</button>  <button type="button" aria-label="Remove Linen napkins">×</button></div>
How it is fixed3 steps
  1. Give each button a min-width and min-height of 32 pixels, comfortably above the 24-pixel minimum. The visible button is the whole hit area, so people can see how much room they have.
  2. Add flex-shrink: 0, which stops a narrow screen from squeezing the buttons back down.
  3. Widen the gap to 4 pixels, so the buttons sit apart.

This fixes the Before and passes 2.5.8, and the HTML does not change.

04

Design ideas

A tidy basket line can still be easy to hit

Four ways to draw the basket line’s controls and the links near them. Point at each one: the fill that appears is the area that takes the click, and on the two that fail, dotted circles show the 24-pixel circles the spacing rule measures. Tab to them too, and press the buttons.

In the design file

  • Draw buttons at their real size, at least 24 by 24 pixels. The guide’s fix uses 32 pixels, and 34 for a round button.
  • When the clickable area is bigger than the icon, draw it as its own shape, such as a 28-pixel square around a 16-pixel icon.
  • Keep at least 24 pixels between the centres of neighbouring buttons, including those in the rows above and below.
  • Draw the row on a 320-pixel-wide screen, with the buttons still at full size.

Passes

  • Linen napkins 2
    A quantity stepper pill The number sits in a soft pill between the two 36-pixel round buttons that change it, and remove is a 36-pixel circle of its own, each filled on hover. A round button needs 34 pixels across to hold the 24-pixel square, so 36 leaves room to spare.
  • A quantity menu and a Remove word No icon buttons at all: a 36-pixel-tall quantity menu in a soft pill, and Remove as an underlined word in a box 32 pixels tall that fills on hover, 12 pixels apart. Two wide targets replace three small ones, and a word can’t be mistaken for minus.

Fails

  • Linen napkins Linen napkinsQty 2
    A remove × on the photo’s cornerWCAG 2.5.8 A white 18-pixel circle perched on the corner of the product photo, which links to the product, so the 24-pixel circle around the button lands on another target: a slip opens the product page, or removes the item. Move it clear of the photo, or make it 34 pixels across.
  • Page numbers that touchWCAG 2.5.8 Each number is a link 16 pixels wide and 20 tall, the current one a 20-pixel dot, and they touch, 16 to 18 pixels centre to centre, so every circle overlaps the next. A pager is a row of links, not a sentence: give each number 24 pixels, or space them out.
05

Verify the fix

4 checks.

Test with: Target measurement, Touch, Mouse, Zoom

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared button styles change.

Limits

This is a starting pattern, not a guarantee for every application. 24 pixels is the minimum at level AA; 44 pixels, as in 2.5.5, is easier for most people, and tap targets smaller than 44 by 44 pixels takes this same row on to that size. The guide covers icon buttons in one row; grids, sliders and drag handles need their own checks. A target big enough to hit can still act on the wrong press: buttons that act on press and can't be cancelled covers taking a slip back. Test with the people and devices your users actually have.

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