CKTIS / HTML
object — embedding a resource with fallback content
The `object` element embeds an external resource as an image or a nested document. Its children provide fallback content displayed when the resource cannot be shown.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<object data="resource-url" type="mime/type" width="320" height="180">Fallback content</object>The object element represents an external resource, handled as an image or a nested document depending on its type. Both start and end tags are required. Its transparent content model means that permitted children depend on the surrounding context.
The HTML Standard requires at least one of data or type to be present. This is an authoring requirement, not a guarantee that the resource will embed successfully. If data is present, its value must be a valid, nonempty resource URL — do not use src here. The type attribute declares a MIME type; it does not convert the data. width and height specify dimensions, name names the nested navigation context if one is created, and form explicitly associates the element with a form.
Children are fallback content, not a permanently displayed caption. They appear in cases including failed fetching or an unsupported or malformed image. After successful embedding, they are not part of the displayed content. Unlike object, embed does not support this fallback content.
Examples
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Object fallback</title>
</head>
<body>
<object data="data:image/png,not-a-png" type="image/png" width="320" height="80">
<p>Image unavailable.</p>
</object>
</body>
</html>Result
Image unavailable.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.