object tag
The object tag, which, when implemented in the code, is written like this - <object>, is an HTML tag that belongs to programming tags. Programming HTML tags are used to insert non-HTML elements inside a document, that is elements that are in other programming languages. These are the tags that allow expanding a document's functions beyond those allowed by HTML and CSS alone.
<object> embeds and external resource, which can be anything from an image to an application. This tag is supported in the current version of HTML, which is HTML5.
Browser support
Here you can see whether <object> is supported by a certain browser, and, if yes, starting from which version it is supported.
Chrome | Firefox | Edge | Opera | Safari |
---|---|---|---|---|
Is supported | Is supported | Is supported | Is supported | Is supported |
Attributes and values
An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.
Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.
What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.
The <object> tag supports the following attributes (with their respective values):
Attribute | Value | Description |
---|---|---|
align |
| Specifies the alignment of the <object> element according to surrounding elements (Not Supported in HTML5) |
archive | URL | A space separated list of URL’s to archives. The archives contains resources relevant to the object (Not Supported in HTML5) |
border | pixels | Specifies the width of the border around an |
classid | class_ID | Defines a class ID value as set in the Windows Registry or a URL (Not Supported in HTML5) |
codebase | URL | Defines where to find the code for the object (Not Supported in HTML5) |
codetype | media_type | The media type of the code referred to by the classid attribute (Not Supported in HTML5) |
data | URL | Specifies the URL of the resource to be used by the object |
declare | declare | Defines that the object should only be declared, not created or instantiated until needed |
form | form_id | Specifies one or more forms the object belongs to |
pixels | pixels | Specifies the height of the object |
pixels | pixels | Specifies the whitespace on left and right side of an object (Not Supported in HTML5) |
name | name | Specifies a name for the object |
text | text | Defines a text to display while the object is loading (Not Supported in HTML5) |
usemap | #mapname | Specifies the name of a client-side image map to be used with the object |
vspace | pixels | Specifies the whitespace on top and bottom of an object (Not Supported in HTML5) |
width | pixels | Specifies the width of the object |
Global Attributes
Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.
<object> supports global attributes.
Event Attributes
Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.
<object> supports event attributes.