<object>

BrandonDusch's avatar
Published Mar 24, 2022Updated Jul 1, 2022
Contribute to Docs

The <object> element represents some resource external to the HTML document. This resource can be treated as an image, an embedded browsing context, or as content to be handled by a browser plugin.

Syntax

<object type="MIME type" data="URL of resource"></object>

The <object> element requires the following attributes to work properly:

  • A type attribute that tells the browser what content media (MIME) type will be displayed. (“application/pdf”, “application/x-java-applet”, “audio/mp4”, etc.)
  • A data attribute that contains the URL to the resource being used.

This element may contain zero or more <param> elements to pass parameters on to the resource it is displaying:

<object type="MIME type" data="URL of resource">
<param name="parameter name" value="parameter value" />
</object>

Example

<object
width="420"
height="315"
type="video/mp4"
data="https://www.youtube.com/v/138enunVlfs"
></object>

All contributors

Contribute to Docs

Learn HTML on Codecademy