object

FilterElements

<object> ... </object>

A generic element used for embedding media (such as an image, applet, movie, audio, or even another HTML file) on a web page. The attributes required for the object element vary with the type of content it is placing. The object element may contain content that will be rendered if the object cannot be embedded. The object element may also contain a number of param elements that pass important information to the object when it displays or plays. Not all objects require additional parameters. The object and param elements work together to allow authors to specify three types of information:

Notes

The object element began as a proprietary element in Internet Explorer to support ActiveX and later Java applets. Browser support for the object element does not live up to the W3C’s vision of object as an all-purpose object placer; for example, it is not currently possible to reliably place images with the object element.

Start/End Tags

Required/Required

Specifications

  • HTML 4.01
  • HTML5

align=

Values: bottom | middle | top | left | right
Deprecated. Not in HTML5. Aligns object with respect to surrounding text.
bottom
Aligns the bottom of the object with the text baseline. This is the default vertical alignment.
left
Aligns the object on the left margin and allows subsequent text to wrap around it.
middle
Aligns the text baseline with the middle of the object.
right
Aligns the object on the right margin and allows subsequent text to wrap around it.
top
Aligns the top of the object with the top of the tallest object on that line.

archive=

Values: URLs
Not in HTML5. Specifies a space-separated list of URLs for resources that are related to the object.

border=

Values: number
Deprecated. Not in HTML5. Sets the width of the border in pixels if the object is a link.

classid=

Values: URI
Not in HTML5. Identifies the location of an object’s implementation. It is used with or in place of the data attribute. The syntax depends on the object type. Not supported by Gecko browsers.

codebase=

Values: URI
Not in HTML5. Identifies the base URL used to resolve relative URLs in the object (similar to base). By default, codebase is the base URL of the current document.

codetype=

Values: content-type
Not in HTML5. Specifies the media type of the code. It is required only if the browser cannot determine an applet’s MIME type from the classid attribute or if the server does not deliver the correct MIME type when downloading the object.

data=

Values: URI
Specifies the address of the resource. The syntax depends on the object.

declare

Values: None in HTML. (declare="declare" in XHTML)
Not in HTML5. Declares an object but restrains the browser from downloading and processing it. Used in conjunction with the name attribute, this facility is similar to a forward declaration in a more conventional programming language, letting you defer the download until the object actually gets used.

form=

Values: form id
HTML5 only. Associates the object with a form element on the page.

height=

Values: number
Specifies the height of the object in pixels.

hspace=

Values: number
Deprecated. Not in HTML5. Specifies the number of pixels of clear space to the left and right of the object.

name=

Values: text
Specifies the name of the object to be referenced by scripts on the page.

standby=

Values: message
Not in HTML5. Specifies the message to display during object loading.

tabindex=

Values: number
Specifies the position of the current element in the tabbing order for the current document. The value must be between 0 and 32,767. It is used for tabbing through the links on a page (or fields in a form).

type=

Values: type
Specifies the media type of the resource.

usemap=

Values: URL
Specifies the image map to use with the object.

vspace=

Values: number
Deprecated. Not in HTML5. Specifies the number of pixels of clear space above and below the object.

width=

Values: number
Specifies the object width in pixels.
<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"
height="280" width="320"
codebase="http://activex.microsoft.com/
activex/controls/mplayer/en/
nsmp2inf.cab#version=6,4,7,111">
  <param name="URL" value="movies/europe.wmv">
  <param name="autoStart" value="false">
  <param name="UIMode" value="full">
You do not have Windows Media Player installed.
Get it here. </object>

Rendered Example

This embedded media can not be displayed in this application.