Frames need a title
- Rule:
axe/frame-title - Checks: Frames must have an accessible name
- WCAG: 4.1.2
- Fix class:
content: A fix needs authored text.
Who it affects
Section titled “Who it affects”- People who use a screen reader or a braille display, most of them blind.
How to fix it
Section titled “How to fix it”An embedded map, video, form or widget has no title
Section titled “An embedded map, video, form or widget has no title”Give the <iframe> a title that says what the frame holds, decided from its content, such as the map’s subject or the video’s topic. The framed page’s own <title> does not name the frame.
<iframe src="/embed/store-map" title="Map of our Denver store"></iframe>A third-party script inserts the iframe
Section titled “A third-party script inserts the iframe”Set the title through the embed’s own option if it has one. Otherwise set the title from your code once the iframe is inserted.
The frame holds nothing for people, such as a tracking or messaging frame
Section titled “The frame holds nothing for people, such as a tracking or messaging frame”Hide it with the hidden attribute or display: none, which removes it from the accessibility tree and the Tab order.
Fixes that fail
Section titled “Fixes that fail”Using a generic title, such as iframe or Embedded content
Section titled “Using a generic title, such as iframe or Embedded content”axe accepts it, but screen reader users still cannot tell what the frame holds or whether to enter it.
Adding role="presentation" to a frame that shows content
Section titled “Adding role="presentation" to a frame that shows content”axe accepts a presentational frame, but the role does not hide the frame’s document: screen readers still reach its content, now with no name.
Adding tabindex="-1" to the frame
Section titled “Adding tabindex="-1" to the frame”axe skips such frames for this rule, but screen readers still read their content, and in Chrome and Firefox keyboard users can no longer tab into them.
More on the rule
Section titled “More on the rule”axe-core’s documentation of the rule
CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.