Frames with focusable content must not have tabindex="-1"
Do not put tabindex="-1" on an iframe that contains links, buttons or form fields. It takes the whole frame out of the Tab order, so keyboard users cannot reach anything inside it.
| Rule ID | frame-focusable-content |
|---|---|
| Impact | Serious |
| Success criterion | 2.1.1 Keyboard · A |
| Standards | WCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549 |
| Fixed automatically |
Example
<iframe src="/booking-widget.html" title="Table booking" tabindex="-1"></iframe>Tab skips the booking form entirely. A keyboard user cannot book a table.
<iframe src="/booking-widget.html" title="Table booking"></iframe>Tab moves into the frame and through its date, time and Book fields.
Why it matters
In most browsers, tabindex="-1" on a frame does more than remove the frame element itself from the Tab order. Everything inside the frame becomes unreachable with the Tab key as well.
That hurts anyone who navigates by keyboard: people with motor disabilities, switch and sip-and-puff users, and screen reader users who tab between form fields. Frames often hold the most important parts of a page: a payment form, a booking widget, a video player, a map or a support chat. If they cannot reach it, they cannot complete the task, which fails WCAG 2.1.1 Keyboard at Level A.
The attribute is often added by accident, copied from embed code or added to stop a frame from "stealing" focus.
How to fix it
Remove the attribute. In most cases this is the whole fix:
<iframe src="/booking-widget.html" title="Table booking"></iframe>
Third-party embed code adds it. Check the provider's settings for a keyboard or accessibility option, or edit the snippet before pasting it. If a script sets it at runtime, report it to the vendor.
You wanted to let users skip a long embed, such as a map. Keep the frame reachable and add a skip link before it instead:
<a href="#after-map" class="skip-link">Skip map</a>
<iframe src="/map.html" title="Store locations"></iframe>
<h2 id="after-map" tabindex="-1">Opening hours</h2>
The frame is not meant to be used at all, for example a tracking pixel or a hidden helper frame. Hide it completely with the hidden attribute or display: none, so it is removed for everyone, and make sure its content has no focusable elements.
Whatever you change, give every frame a short, meaningful title.
Checklist
- Remove tabindex="-1" from frames people need to use.
- Check embed snippets for tabindex before pasting them.
- Use a skip link to let users bypass long embeds.
- Hide unused frames completely instead.
How the check works
The check runs inside each frame whose element has tabindex="-1" and is larger than one pixel. It fails when the frame's document contains any element in the Tab order, such as a link, button or form field. Frames the check cannot enter cannot be tested: tab through them by hand to confirm their content is reachable.
Resources
- Understanding 2.1.1 Keyboard W3C
- W3C ACT rule akn7bn W3C ACT
- Developing a keyboard interface W3C WAI
Updated October 27, 2026