Skip to main content

The <embed> Element

As defined in the HTML Living Standard, the <embed> element provides an integration point for an external resource, typically a non-HTML resource such as a media player or an interactive application.

Visual Representation:
<embed src="interactive-app.swf" type="application/x-shockwave-flash"> View HTML Living Standard: The embed element

Technical Requirements

WCAG Requirement: Name, Role, Value

Success Criterion 4.1.2 (Level A): For all user interface components, the name and role can be programmatically determined.

Unlike <iframe>, the <embed> tag does not have a title attribute that is reliably used as an accessible name by all screen readers. To ensure compliance, wrap the <embed> in a container and use aria-label or aria-labelledby to describe the content.

Understand SC 4.1.2: Name, Role, Value

Accessibility Warning: The Lack of Fallback

The <embed> element is a void element, meaning it does not have a closing tag and cannot contain fallback text content.

A11y Comparison: Use Object Instead?

Because <embed> offers no native way to provide an alternative for users whose browsers or assistive technologies cannot render the plugin, it is often safer to use the <object> element or more specific media tags like <video> or <audio>.

<!-- Better Alternative with Fallback --> <object data="app.pdf" type="application/pdf"> <p>Your browser cannot display this PDF. <a href="app.pdf">Download it here.</a></p> </object>

Best Practices