HTML <object> Tag
Description
The <object> tag is used to embed external resources into an HTML document. It acts as a container that allows different types of content - such as multimedia, documents, or interactive media - to be displayed directly within a web page.
Unlike simpler embedding elements, the <object> tag is highly versatile and can load a wide range of external resources, including images, PDFs, audio files, videos, and even other HTML documents. Because of this flexibility, it has historically been used for embedding plugins and rich media content.
One of the key strengths of the <object> element is that it can include fallback content. If the browser cannot display the embedded resource, any content placed inside the <object> tags will be shown instead. This makes it useful for providing alternative messages, links, or instructions to users when the embedded content fails to load or is unsupported.
The <object> element can also interact with scripts and styles, allowing embedded content to integrate with the rest of the page. When used to embed HTML documents, the content behaves as a nested browsing context, similar to an inline frame, though with more flexibility in how data is passed and handled.
In modern web development, the <object> tag is used less frequently than in the past, as newer elements such as <img>, <video>, <audio>, and <iframe> provide more specialized and predictable behavior. However, <object> remains useful in situations where multiple content types must be supported or when fallback handling is important.
Properties
- Permitted Parents
- Any element that accepts embedded content
- Content
- Block, inline, and text; any <param> elements must come first
- Start/End Tags
- Start tag: required, End tag: required
Example
Attributes
- data
- Defines a URL that refers to the object's data.
- type
-
Defines the MIME type of data specified in the
dataattribute. - name
- Defines the name for an object (to use in scripts).
- usemap
- Specifies a URL of a client-side image map to be used with the object.
- width
- Defines the width of the object.
- height
- Defines the height of the object.
Global Attributes
The <object> tag also supports the Global Attributes in HTML5
Event Attributes
The <object> tag also supports the Event Attributes in HTML5
Browser Support
The following information will show you the current browser support for the HTML <object> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.
This tag is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
