object-altEmbedded object has no text alternative
An <object> element, often an embedded PDF or map, with no text alternative is announced as nothing or just as “object”. Give it a name with aria-label or title, and put a fallback link to the file inside it.
Who it hurts
Screen reader users, and anyone whose browser can’t show the embedded file, such as many phone browsers with PDFs.
Menus, price lists and size guides are often embedded as PDFs. Without a name or fallback, there is no way to know what is there or to open it.
How to fix it
Pick your stack. Review every change before you ship it.
Before
<object data="menu.pdf" type="application/pdf"></object>After
<object data="menu.pdf" type="application/pdf" aria-label="Lunch menu (PDF)">
<a href="menu.pdf">Download the lunch menu (PDF, 200 KB)</a>
</object>Check it by hand too
Reach the embed with a screen reader and check it is named. Open the page on a phone and check the fallback link works.
Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.
WCAG reference
- 1.1.1 Non-text Content (Level A). Understanding 1.1.1