Non-text Contrast
The parts of a control that tell you it is a control — the input’s edge, the checkbox box, the focus ring, the chart key — need 3:1 against whatever sits behind them.
- Principle
- Perceivable
- Guideline
- 1.4
- Level
- AA
- In WCAG since
- 2.1
- Number
- 1.4.11
Broken, then fixed
The same interface twice: first with the mistake, then with the smallest change that fixes it.
The field and checkbox edges vanish; only the placeholder hints anything is editable.
Email address
Fails: Borders need at least 3:1. This border has 1.1:1.
Fails: Borders need at least 3:1. This border has 1.2:1.
The border is a hair lighter than the surface it sits on. Sighted users with good vision fill in the edge from memory; nobody else can.
One border colour, changed on every control at once.
Email address
Passes: Borders need at least 3:1. This border has 5.4:1.
Passes: Borders need at least 3:1. This border has 4.7:1.
The same layout, the same type, the same spacing. The only change is the border — and now the control announces itself.
What changed in the code
The fix as a diff: removed lines are marked with a minus, added lines with a plus.
.field,
.checkbox {
removed: border: 1px solid #EBEBEB; /* fails 1.4.11 */
added: border: 1px solid #6A6A6A; /* passes */
border-radius: 4px;
}
Lines are marked - and + as well as tinted, so the diff reads without colour. One declaration fixes every control that shares the class.
How to test
Check your own interface against 1.4.11, one step at a time.
- List each control whose edge people need to see to find it: text inputs, checkboxes, radio buttons, switches, and buttons with only an icon.
- Measure each edge against the background next to it with the DevTools colour picker or the free Colour Contrast Analyser. It needs at least 3:1.
- Check each state that shows by appearance alone: the tick in a checked box, the knob of a switch, the marker under the selected tab. Each needs 3:1 against what is next to it.
- Tab through the page and measure the focus indicator of each control against the background around it. It needs 3:1 too.
- Find the graphics people need to understand the content, such as icons with no text, chart lines and pie segments, and measure each against its background. Leave out parts whose information is also given in text, such as a pie segment with its value printed on it.
- Leave out disabled controls, and controls left in the browser’s default style.
Common questions
Does a button with text need a visible border to pass 1.4.11?
No. When the text shows that it is a button, no edge is needed. A border helps some people, but 1.4.11 does not ask for one.
Does the focus indicator need 3:1 contrast?
Yes. A focus indicator is a visual state of the control, and W3C says it needs 3:1 against the background next to it.
Do disabled controls need 3:1 contrast?
No. Controls people cannot use are exempt, and so are controls whose look the browser sets and the author has not changed.
Try it yourself
A lab is a small working piece of interface that you change yourself. Read its steps, use the controls under it, and watch the verdict line at the bottom: it says whether the criterion passes or fails as you go. Reset puts it back.
Try it: check your own colours
Try it: fade the edges
How to use this lab
- Goal. Find how faint the edges of a field and a checkbox can get before people lose them.
- The controls. The Fade the edges slider fades the borders of the Email address field and the Email me order updates checkbox towards the white background. “Vision filter” shows the mock in Full colour, in Greyscale, or as seen without red, green or blue cones. Edges against the background gives the contrast ratio, and the check under it says whether it reaches 3 : 1.
- Try this. Drag Fade the edges from 0% faded to about 30% faded and watch the ratio drop below 3 : 1. Then try each filter: the edges are grey, so they barely change.
- What it means. 1.4.11 passes while the edges have at least 3 : 1 against the background, and fails below that. Fainter edges leave people with low vision unable to see where the field and the checkbox are, so they can’t find them to use them. The verdict line under the lab says which.
The contrast ratio compares how bright the two colours are. 1 : 1 means the colours are identical, so text in them is invisible; 21 : 1 is black on white, the most there is. The higher the number, the easier it is to read.
On the scale from 1 : 1 to 21 : 1, 5.40 : 1 is between 4.5 : 1 and 7 : 1: enough for body text at AA, not at AAA.
Why the thresholds differ
- Body text needs 4.5 : 1 (1.4.3, Level AA). That is any text below large size.
- Large text needs 3 : 1 (1.4.3). Large means at least 24px, or 18.66px and bold. Bigger, heavier letters stay readable with less contrast.
- At Level AAA, body text needs 7 : 1 (1.4.6), for people with moderately low vision.
- Borders and icons need 3 : 1 (1.4.11): the edge of a field or checkbox, a focus ring or an icon, against what is next to it. You have to see that they are there, not read them.
- PassesBorders and icons, AA · 1.4.11Borders and icons need at least 3 : 1. These edges have 5.40 : 1.
1.4.11 passes
Also in guideline 1.4
Criteria in the same guideline often fail together.
- 1.4.1, PerceivableLevel A
Use of Color
Fails when: Hue is the only signal.
- 1.4.2, PerceivableLevel A
Audio Control
Fails when: Autoplaying audio with no control on the page.
- 1.4.3, PerceivableLevel AA
Contrast (Minimum)
Fails when: Hierarchy built by fading text out.
- 1.4.4, PerceivableLevel AA
Resize Text
Fails when: A fixed-height box clips its own text when enlarged.
- 1.4.5, PerceivableLevel AA
Images of Text
Fails when: A headline exported as an image.
- 1.4.10, PerceivableLevel AA
Reflow
Fails when: Fixed-width columns make the page scroll sideways as well as down at 320px wide.