This website uses cookies

We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. Please read more at our privacy policy page.



HTML <object> Tag

The <object> tag defines an embedded object within an HTML document. It is generally used for embedding multimedia (audio, video, Java applets, Flash applications, etc) or another HTML document into the web page.

You can include alternative text in the <object> tag that will be shown if the browsers doesn’t support this tag.

You can use the <param> tag to pass parameters to plugins that have been embedded using the <object> tag.

Syntax

The <ul> tag comes in pairs. The content is written between opening (<object>) and closing (</object>) tags. The <object> tag is used as a child element of <body>.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the webpage</title>
  </head>
  <body>
    <p>Steve Jobs' Stanford Commencement Address - YouTube</p>
    <object width="320" height="240" data="https://www.youtube.com/embed/bZNEB_o3Hzw?ecver=2">
    </object>
  </body>
</html>

Result

Attributes

Attribute Value Description
align top
bottom
middle
left
right
Specifies the alignment of the content inside <object> element according to surrounding elements.
Not supported in HTML 5.
archive URL Defines a list of URLs to archives containing resources relevant to the object.
Not supported in HTML5.
border pixels Sets the width of the border around an <object>.
Not supported in HTML5.
classid URL Sets the URL of the object's implementation. It can be used together with, or instead of, the data attribute.
Not supported in HTML5.
codebase URL Defines the path used to resolve relative URIs specified by classid, data, or archive. If not specified, the default is the base URI of the current document.
Not supported in HTML5.
codetype media_type Sets media type of the code referred to by the classid attribute.
Not supported in HTML5.
data URL Sets the URL of the resource that will be used by the object.
declare declare Specifies that the object should only be declared.
Not supported in HTML5.
form form_id Specifies one or more forms <object> belongs to.
height pixels Specifies the height of the object.
hspace pixels Specifies the whitespace on left and right side of an object.
Not supported in HTML5.
name name Specifies a name for the object.
standby text Specifies a text to be displayed while the object is loading.
Not supported in HTML5.
tabindex number Sets the position of the element in the tabbing navigation order for the current document.
type media_type Specifies the media type of data specified in the data attribute.
usemap #mapname Specifies the name of a client-side image map to be used with the object (a hash-name reference to the <map> element).
vspace pixels Sets the whitespace on top and bottom of an object.
Not supported in HTML5.
width pixels Set the width of the object.

The <object> tag also supports the Global attributes and the Event Attributes.

Browser support