Skip to main content

The <object> Element

As defined in the HTML Living Standard, the <object> element is a general-purpose container for an external resource. It is more flexible than <embed> because it allows for fallback content.

Visual Example (with Fallback):

Your browser does not support this object. Click here to download the image.

<object data="document.pdf" type="application/pdf" width="100%" height="500px">
  <p>Fallback content for browsers that cannot render the PDF.</p>
</object>
View HTML Living Standard: The object element

Accessibility: The Power of Fallbacks

The primary accessibility advantage of <object> over <embed> is the ability to provide fallback content inside the tag.

WCAG Principle: Robustness

Success Criterion 4.1.1 (Parsing): While parsing is less critical in HTML5, providing a meaningful fallback ensures that users with older browsers or assistive technologies that cannot process the external resource still receive the core information.

Always ensure the fallback content is a text-based equivalent of the object's purpose.

Usage & Best Practices