Note/Warning/Danger/Info/Success You can use multiple attributes with the <object> tag but few of them are deprecated and replaced with the new attributes so use the new attributes instead.
HTML <object> tag
The <object> tag helps to embed –
- The multimedia files in the HTML document. These multimedia file can be video, audio, PDF, Flash, Java applets, ActiveX, etc.
- A web page into your HTML document.
To define some extra parameters for the embedded object, you should use the <param> tag with the <object> tag.
Syntax:
<object data=”imgpath” width=”width-value” height=”height-value”></object>
Default value
NONE
How Browser will display
INLINE
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
NA | NA | Few of the attributes which are used with <object> tag are deprecated in HTML5 and they are replaced with new attributes |
Attributes used with <object> tag
Attribute | Description |
---|---|
width | Describes the width of the object in Pixels. |
height | Describes the height of the object in Pixels. |
data | Describes resource URL for the object. |
form | The form attribute defines one or more forms for the elements to which it belong using the form_id. |
name | Describes the name of the element. |
type | This is set on the data attribute inform about the type of media file using media_type. |
usemap | It describes that image has a client-side image-map using a URL. |
align | To align the object to top, right, bottom, left or center. (HTML5 does not support this attribute when it is used with the <object> tag). |
border | Sets the border of the element in Pixels. (HTML5 does not support this attribute when it is used with the <object> tag). |
codebase | Tells us the URL to find the code for the object. (HTML5 does not support this attribute when it is used with the <object> tag). |
hspace | Sets the whitespace in Pixels for the object's left and right side. (HTML5 does not support this attribute when it is used with the <object> tag). |
vspace | Sets the whitespace Pixels on the object's top and bottom side. (HTML5 does not support this attribute when it is used with the <object> tag). |
classid | Usig class_id, it defines a Class ID as set in the URL or Window Registry. (HTML5 does not support this attribute when it is used with the <object> tag). |
codetype | Using media_type, it is the Internet media type of the code referred by the classid attribute. (HTML5 does not support this attribute when it is used with the <object> tag). |
standby | Uses text to display during the time when the object loads. (HTML5 does not support this attribute when it is used with the <object> tag). |
Note/Warning/Danger/Info It is mandatory to code <data> or <type> attribute along with this tag.
Global Attributes
The <object> tag supports the Global attributes.
Event Attributes
The <object> tag supports the Event attributes.
Supporting Browsers
Related Tags
The <img> tag is a similar tag.