HTML <object> tag

Updated: 09/12/2023 by Computer Hope
HTML object tag

When writing in HTML (hypertext markup language), the <object> tag is a block element used to designate an object embedded in to a web page. It is useful for adding plugin handled resources such as Java applets, Flash, PDF (Portable Document Format), and ActiveX and audio and video. Like <iframe>, the <object> tag lets you nest one web page within another.

The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Tip

The <param> tag can pass parameters to a plugin that is embedded using the <object> tag.

Example of <object> code

<object type="application/x-shockwave-flash" height="60" width="60"
data="https://www.computerhope.com/jargon/f/flash.swf">
Your browser does not support the &lt;object&gt; tag.
</object>

Example result

Your browser does not support the <object> tag.

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <object> tag has the following unique attributes.

Attribute Description
data Designates the URL (uniform resource locator) of the resource embedded in the <object> element.
form Designates the form(s) of where an object belongs.
height Designates the height of the object.
name Designates a name for the object.
type Designates the media type of data specified by the data attribute.
usemap Designates that an image is a client-side image map.
width Designates the width of the image.

Deprecated attributes

In addition to the above attributes, the <object> tag had the following deprecated attributes.

Attribute Description
align Designates the alignment of the object with respect to the content around it.
archive Designates a list of URL's to different archives.
border Designates the width of the border surrounding the object.
classid Designates a class ID value as set in the Windows registry or a URL.
codebase Designates the location of an object's code.
codetype Designates the media type of the code listed in the classid attribute.
declare Designates that the object should only be declared, not created or represented until called.
hspace Designates the whitespace on right and left side of an object.
standby Designates the text that displays while the object loads.
vspace Designates the whitespace above and below an object.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Browser, Client-side, Compatibility, Container tag, Image map, Nesting, Object, Server-side, Web design terms, Web page, Whitespace