| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object#attr-height | [Back] [Original] |
Get to know MDN better
<object> HTML external object elementThis feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The <object> HTML element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.
<object
type="video/mp4"
data="/shared-assets/videos/flower.mp4"
width="250"
height="200"></object>
This element includes the global attributes.
archive A space-separated list of URIs for archives of resources for the object.
border The width of a border around the control, in pixels.
classid The URI of the object's implementation. It can be used together with, or in place of, the data attribute.
codebase The base path used to resolve relative URIs specified by classid, data, or archive. If not specified, the default is the base URI of the current document.
codetype The content type of the data specified by classid.
dataThe address of the resource as a valid URL. At least one of data and type must be defined.
declare The presence of this Boolean attribute makes this element a declaration only. The object must be instantiated by a subsequent <object> element. Repeat the <object> element completely each time the resource is reused.
formThe form element, if any, that the object element is associated with (its form owner). The value of the attribute must be an ID of a <form> element in the same document.
heightThe height of the displayed resource, as in <integer> in CSS pixels.
nameThe name of valid browsing context (HTML5), or the name of the control (HTML 4). The name becomes a property of the Window and Document objects, containing a reference to the embedded window or the element itself.
standby A message that the browser can show while loading the object's implementation and data.
typeThe content type of the resource specified by data. At least one of data and type must be defined.
usemap A hash-name reference to a <map> element; that is a '#' followed by the value of a name of a map element.
widthThe width of the display resource, as in <integer> in CSS pixels.
The <object> element can display PDFs using the browser's built-in PDF viewer. Its children provide fallback content when the resource cannot be displayed. You can use this to provide a link to the PDF, but also provide a link outside the element so it remains available if the viewer loads but fails to display the PDF.
Unlike <iframe>, <object> has no attributes that control loading. The embedding page's Content Security Policy controls its sources through object-src.
<object
type="video/webm"
data="/shared-assets/videos/flower.webm"
width="600"
height="140">
<img
src="/shared-assets/images/examples/flowers.jpg"
alt="Some beautiful flowers" />
</object>
If the video in the example fails to load, the user will be provided with an image as fallback content. The <img> tag is used to display an image. We include the src attribute set to the path to the image we want to embed. We also include the alt attribute, which provides the image with an accessible name. If the image also fails to load, the content of the alt attribute will be displayed.
| Content categories |
Flow content;
phrasing content;
embedded content, palpable content; if the element has a
usemap attribute, interactive content;
listed,
submittable
form-associated element.
|
|---|---|
| Permitted content |
zero or more <param> elements, then
transparent.
|
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts embedded content. |
| Implicit ARIA role | No corresponding role |
| Permitted ARIA roles |
application, document, img
|
| DOM interface | HTMLObjectElement |
| Specification |
|---|
| HTML # the-object-element |
This page was last modified on Sep 16, 2026 by MDN contributors.
<a><abbr><acronym><address><area><article><aside><audio><b><base><bdi><bdo><big><blockquote><body><br><button><canvas><caption><center><cite><code><col><colgroup><data><datalist><dd><del><details><dfn><dialog><dir><div><dl><dt><em><embed><fencedframe><fieldset><figcaption><figure><font><footer><form><frame><frameset><geolocation><h1><h6><head><header><hgroup><hr><html><i><iframe><img><input><ins><kbd><label><legend><li><link><main><map><mark><marquee><menu><meta><meter><nav><nobr><noembed><noframes><noscript><object><ol><optgroup><option><output><p><param><picture><plaintext><pre><progress><q><rb><rp><rt><rtc><ruby><s><samp><script><search><section><select><selectedcontent><slot><small><source><span><strike><strong><style><sub><summary><sup><table><tbody><td><template><textarea><tfoot><th><thead><time><title><tr><track><tt><u><ul><var><video><wbr><xmp>accesskeyanchorautocapitalizeautocorrectautofocusclasscontainertimingcontainertimingignorecontenteditabledata-*dirdraggableenterkeyhintexportpartsheadingoffsetheadingresethiddenidinertinputmodeisitemiditempropitemrefitemscopeitemtypelangnoncepartpopoverslotspellcheckstyletabindextitletranslatevirtualkeyboardpolicywritingsuggestions<input type><input type="button"><input type="checkbox"><input type="color"><input type="date"><input type="datetime-local"><input type="email"><input type="file"><input type="hidden"><input type="image"><input type="month"><input type="number"><input type="password"><input type="radio"><input type="range"><input type="reset"><input type="search"><input type="submit"><input type="tel"><input type="text"><input type="time"><input type="url"><input type="week"><script type>Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |