English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <object> tag

HTML: The <object> tag is used as a container to embed external resources into HTML documents, such as audio, video, Flash, PDF, external applications, or browser plugins. Due to compatibility issues, the <object> tag is more commonly used to embed resources than the <embed> tag. This tag is also commonly referred to as the <object> element.

Online Example

Use the <object> element to add a Flash file to HTML:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Basic Tutorial Website(oldtoolbag.com)</title> 
</head>
<body>
<object type="application/x-shockwave-flash" src="bookmark.swf" width="400" height="300"></object>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeOpera

Chrome

Safari

Currently, most browsers support the <object> tag.

Tag definition and usage instructions

Define an embedded object. Use this element to add multimedia to your XHTML page. This element allows you to specify the data and parameters of the object to be inserted into the HTML document, as well as the code that can be used to display and operate the data.

<object> tag is used to include objects, such as images, audio, video, Java applets, ActiveX, PDF, and Flash.

object's original intention was to replace img and applet elements. However, due to vulnerabilities and lack of browser support, this was not achieved./browser's object support depends on the object type. Unfortunately, mainstream browsers use different code to load the same object type.

Fortunately, the object object provides a solution. If the object element is not displayed, the code located between <object> and <5object> code. In this way, we can nest multiple object elements (each corresponding to a browser). 4.01Compared to the <embed> tag, the <object> tag is more commonly used to embed external resources because the <object> tag is closely related to HTML

HTML 4.01 HTML5and XHMTL are compatible.

with HTML 4.01 Some differences in HTML5 Attributes in HTML

"form" is not supported in HTML.5 Newly defined attributes.

In HTML5 In HTML, objects can be submitted within a form.

In HTML5 In HTML, objects no longer appear within the <head> element area.

Attribute

AttributeValueDescription
aligntop bottom middle left rightHTML5 Not supported. HTML 4.01 Deprecated. Specifies the alignment of the <object> element relative to surrounding elements.
archiveURLHTML5 Not supported. A space-separated list of URLs pointing to archive files. These archive files contain resources related to the object.
borderpixelsHTML5 Not supported. HTML 4.01 Deprecated. Specifies the border width around the <object> element.
classidclass_IDHTML5 Not supported. Defines the ID value of a class embedded in the Windows Registry or at a URL, this attribute can be used to specify the location of the object included in the browser, usually a Java class.
codebaseURLHTML5 Not supported. Defines where the code required by the object can be found, providing a base URL.
codetypeMIME_typeHTML5 Not supported. The MIME type of the code referenced by the classid attribute.
dataURLSpecifies the URL of the resource used by the object.
declaredeclareHTML5 Not supported. Defines that the object can only be declared and cannot be created or instantiated until the object is applied.
formHTML5form_idSpecifies one or more forms to which the object belongs.
heightpixelsSpecifies the height of the object.
hspacepixelsHTML5 Not supported. HTML 4.01 Deprecated. Specifies the left and right margins of the object.
namenameSpecifies a name for the object.
standbytextHTML5 Not supported. Defines the text to be displayed while the object is loading.
typeMIME_typeSpecifies the MIME type of the data specified in the data attribute.
usemap#mapnameSpecifies the name of the client-side image map to be used with the object.
vspacepixelsHTML5 Not supported. HTML 4.01 Deprecated. Specifies the top and bottom margins of the object.
widthpixelsSpecifies the width of the object.

Global Attributes

<object> tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<object> tag supports all HTML Event Attributes.

Related Articles

HTML Tutorial:HTML Object Element