Provide a title for <iframe>
elements. This is covered by criterion 4.1.2 (Level A). Iframes, or inline frames are usually used to embed content from another service to a page. Content like YouTube videos or job listings are often embedded as inline frames. It's important to provide a title for these elements so assistive technology users can get information about the content before accessing it.
Some screen readers may read a document's title in the iFrame instead of the title attribute on the <iframe>
tag, if the document's title is available. A best practice would be to use both a title
attribute and the <title>
tag that matches each other to make sure the same title is read across various screen readers.
For iFrames that contain non-readable content, like JavaScript, provide a title to pass automated tests, but be sure to hide the content altogether from screen reader users using aria-hidden="true"
.