By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

HTML Object Tag

Reference on the HTML Object tag, examples of use, and a list of available attributes.

Edited: 2014-12-28 07:08

The object Element of HTML, is used to include objects such as images, audio, videos, Java applets, ActiveX, PDF, and Flash.

It was intended to replace the img and applet elements, but due to bugs and compatibility issues with user agents (browsers), this has not happend.

Attributes

Standard Attributes

Attribute: Value: Description: DTD:
Attrs Other Attributes Common, Event, I18n STF
declare (declare) Makes the current OBJECT Definition a Declaration only. STF
classid URI Identifies a Plugin. I.e. Which version of Java to use. STF
codebase URI Base URI for classid, default is the base of the current Document. STF
data URI A Reference to the object's data. I.e. For objects defining images. STF
type ContentType Content Type, aka MIME type of the Data Attribute. Note the HTTP Content-Type takes Precedence. STF
codetype ContentType The Mime Type of the media referred to by the classid attribute. If absent, it will default to the value of the Type Attribute. STF
archive Character Data A Space-separated list of URIs. STF
standby Character Data Defines a message to show while the object is loading. STF
height Length Unit It is recommended to use the CSS Height Property instead. STF
width Length Unit It is recommended to use the CSS Width Property instead. STF
usemap URI Specifies the location of a client-side image map, to be used with the Object. STF
name Character Data This is used in scripts, to identify the element, when submitted through a form. STF
tabindex Number The elements Position in the Tabbing Order. STF

DTD. Defines which document type the attribute is allowed. S=Strict, T=Transitional, F=Frameset.

Example

<object type="application/x-shockwave-flash"
data="Player.swf?path=Video.swf" style="width:320px;height:240px;">
<param name="movie" 
value="Player.swf?path=Video.swf">
</object>

Above would embed a video in a webpage, see also: Streaming Video in HTML Pages