Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
The object element is a legacy mechanism for embedding external resources. Modern alternatives like img, video, audio, iframe, and svg are preferred.
The <object> element embeds an external resource such as an image, PDF, or SVG. It is a legacy embedding mechanism from earlier HTML specifications, originally designed to handle plugin content (Flash, Java applets, etc.).
In modern HTML, dedicated elements handle each media type more effectively. The main remaining advantage of <object> is its fallback content pattern: any HTML placed between the opening and closing tags is displayed when the external resource cannot be loaded.
In nearly all cases, a modern alternative is the better choice. Consider <object> only when you specifically need the nested fallback pattern for a non-HTML resource.
Embed an SVG file with a PNG fallback for older browsers.
<object data="diagram.svg" type="image/svg+xml" width="400" height="300"> <p>Your browser does not support SVG. <a href="diagram.png">View as PNG</a>.</p></object>
Display a PDF inline with a download link fallback.
<object data="document.pdf" type="application/pdf" width="100%" height="600"> <p>This browser does not support inline PDFs. <a href="document.pdf">Download the PDF</a>.</p></object>
<object> elements can be nested to create a fallback chain. The browser tries each in order, stopping at the first one it can render.
<object data="animation.svg" type="image/svg+xml"> <object data="animation.gif" type="image/gif"> <img src="animation.png" alt="Animated diagram showing data flow" /> </object></object>
Unlike void elements such as <img> and <embed>, <object> supports fallback content between its tags. This content is rendered when:
data cannot be loadedtype attribute specifies an unsupported formatThis makes <object> useful for progressive enhancement scenarios where you want a graceful degradation path.
| Attribute | Description |
|---|---|
data |
URL of the resource to embed. Required for most use cases. |
type |
MIME type of the resource (e.g., image/svg+xml, application/pdf). Helps the browser decide how to handle the content. |
width |
Display width of the object in pixels. |
height |
Display height of the object in pixels. |
name |
Name for the embedded browsing context (used with forms and links targeting this object). |
form |
Associates the object with a <form> element by ID. |
This element also supports global attributes.
Because <object> embeds opaque external content, accessibility depends on providing good fallback content and ARIA attributes.
<object data="chart.svg" type="image/svg+xml" role="img" aria-label="Quarterly revenue chart"> <p>Quarterly revenue: Q1 $1.2M, Q2 $1.5M, Q3 $1.8M, Q4 $2.1M.</p></object>
<object> tagsrole="img" and aria-label when embedding images or charts<img>, <video>) which have built-in accessibility semantics<embed> - Void element for embedding; no fallback content support<iframe> - For embedding HTML documents with full security controls<img> - For images (raster and external SVG); use alt text instead of fallback content<video> - For video with native controls, captions, and multiple sources<audio> - For audio with native controls and multiple sources<svg> - For inline vector graphics with full CSS and DOM control