Loading...
Loading...
00:00:00

<object> Tag : Insert multimedia content

The <object> tag in HTML5 is used to embed multimedia content, such as videos, images, and audio files, into a HTML document. The <object> tag is a generic container for different types of media and can be used to embed content from other sources, such as Flash animations or Java applets.

Here's a basic example of how to use the <object> tag:

<object data="example.pdf" type="application/pdf" width="500" height="375">
  <p>It appears your browser does not support PDF files. You can download the file <a href="example.pdf">here</a>.</p>
</object>

In this example, the <object> tag is used to embed a PDF file into the HTML document. The data attribute is used to specify the source of the file, while the type attribute is used to specify the type of the content, in this case a PDF file. The width and height attributes are used to specify the size of the embedded content.

If the browser doesn't support the type of content specified in the type attribute, the content inside the <object> tag will be displayed as fallback content. In this example, a message is displayed indicating that the browser does not support PDF files and a link to download the file is provided.

The <object> tag also supports several other attributes, such as width, height, and align, which can be used to control the appearance and behavior of the embedded content.

The <object> tag in HTML5 is a versatile and powerful way to embed multimedia content into a HTML document. Whether you're embedding videos, images, or other types of media, the <object> tag provides a flexible and easy-to-use way to include rich multimedia content in your web pages.