HTML - <object> Tag



The HTML <object> tag is used to embed multimedia in an HTML document. The <param> tag is also used along with this tag to define various parameters.


<!DOCTYPE html>

      <title>HTML object Tag</title>

      <object data = "/html/test.jpg" type = "text/html" width = "300" height  = "200">
         alt : <a href = "/html/test.htm">test.jpg</a>


This will produce the following result −

Global Attributes

This tag supports all the global attributes described in − HTML Attribute Reference

Specific Attributes

The HTML <object> tag also supports the following additional attributes −

Attribute Value Description
align left
Defines visual alignment of the object
archive URL A space separated list of URL's to archives.
border pixels Specifies border width around the object
classid Class ID Defines a class ID value as set in the Windows Registry or a URL.
codebase URL Specifies the path where object code is located.
codetype mime type The internet media type of the code referred to by the classid attribute.
data URL Specifies the URL for Object data.
declare declare Defines that the object should only be declared, not created or instantiated until needed.
height pixels Specifies the hight of the object.
hspace pixels Specifies the horizontal space around the object.
name object
Specifies a unique name for the object
standby text Defines a text to display while the object is loading.
type mime type Defines the MIME type of data specified in the data attribute.
usemap URL Specifies a URL of a client-side image map to be used with the object
vspace pixels Specifies the vertical space around the object.
width pixels Specifies the width of the object.

Event Attributes

This tag supports all the event attributes described in − HTML Events Reference

Browser Support

Chrome Firefox IE Opera Safari Android
Yes Yes Yes Yes Yes Yes