Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

<object>: The External Object element

BaselineWidely available

The<object>HTML element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.

Try it

<object  type="video/mp4"  data="/shared-assets/videos/flower.mp4"  width="250"  height="200"></object>

Attributes

This element includes theglobal attributes.

archiveDeprecated

A space-separated list of URIs for archives of resources for the object.

borderDeprecated

The width of a border around the control, in pixels.

classidDeprecated

The URI of the object's implementation. It can be used together with, or in place of, thedata attribute.

codebaseDeprecated

The base path used to resolve relative URIs specified byclassid,data, orarchive. If not specified, the default is the base URI of the current document.

codetypeDeprecated

The content type of the data specified byclassid.

data

The address of the resource as a valid URL. At least one ofdata andtype must be defined.

declareDeprecated

The presence of this Boolean attribute makes this element a declaration only. The object must be instantiated by a subsequent<object> element. Repeat the<object> element completely each time the resource is reused.

form

The form element, if any, that the object element is associated with (itsform owner). The value of the attribute must be an ID of a<form> element in the same document.

height

The height of the displayed resource, as in<integer> inCSS pixels.

name

The name of valid browsing context (HTML5), or the name of the control (HTML 4). The name becomes a property of theWindow andDocument objects, containing a reference to the embedded window or the element itself.

standbyDeprecated

A message that the browser can show while loading the object's implementation and data.

type

Thecontent type of the resource specified bydata. At least one ofdata andtype must be defined.

usemapDeprecated

A hash-name reference to a<map> element; that is a '#' followed by the value of aname of a map element.

width

The width of the display resource, as in<integer> inCSS pixels.

Examples

Embed a video

HTML

html
<object  type="video/webm"  data="/shared-assets/videos/flower.webm"  width="600"  height="140">  <img    src="/shared-assets/images/examples/flowers.jpg"    alt="Some beautiful flowers" /></object>

Result

If the video in the example fails to load, the user will be provided with an image as fallback content. The<img> tag is used to display an image. We include thesrc attribute set to the path to the image we want to embed. We also include thealt attribute, which provides the image with an accessible name. If the image also fails to load, the content of thealt attribute will be displayed.

Technical summary

Content categoriesFlow content;phrasing content;embedded content, palpable content; if the element has ausemap attribute,interactive content;listed,submittableform-associated element.
Permitted content zero or more<param> elements, thentransparent.
Tag omissionNone, both the starting and ending tag are mandatory.
Permitted parents Any element that acceptsembedded content.
Implicit ARIA roleNo corresponding role
Permitted ARIA rolesapplication,document,img
DOM interfaceHTMLObjectElement

Specifications

Specification
HTML
# the-object-element

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp