HTML object tag

HTML object tag represents embedded content such as images, video or audio. We have to provide the address or URL of the content in the data attribute.


<object data="files/demo.html" type="text/html" width="100%" height="auto">
Try </>

Specific Uses

It may also embed an image. It can also be used to make a map.

Tag omission

Both starting and ending tags are necessary for the object element.

Global Attributes

All the global attributes are applicable on the object element.

Specific Attributes

All the following specific attributes are related to the object element.

<object> tag attributes

data It defines the location of the external resource.
<object data="li.html" type="text/html"> </object>
type It indicates the type of content.
<object data="li.html" type="text/html"> </object>
name It specifies a unique name for the object element.
<object data="li.html" name="list-example"> </object>
width It defines the horizontal dimension of the visual resource.
<object data="li.html"  style="width:100%; height:auto;" > </object>
height It defines the vertical dimension of the visual resource.
<object data="li.html" style="height:1366px; width:100%;"> </object>

Was this article helpful?




Get the newsletter