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">

Tag Uses

Specific uses of <object> tag

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.

Tag Attributes

Attributes that are applicable to <object> tag

It defines the location of the external resource.

<object data="li.html" type="text/html"> </object>

It indicates the type of content.

<object data="li.html" type="text/html"> </object>

It specifies a unique name for the object element.

<object data="li.html" name="list-example"> </object>

It defines the horizontal dimension of the visual resource..

<object data="li.html"  style="width:100%; height:auto;" > </object>

It defines the vertical dimension of the visual resource.

<object data="li.html" style="height:1366px; width:100%;"> </object>

Was this article helpful?