The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <NOSCRIPT> | Next Tag: <OL> |


<OBJECT>

Inserts an object—such as a sound file or a Java applet—into the page.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later
Notes:
  • This tag's purpose is to eventually replace some or all of the following tags: <APPLET>, <BGSOUND>, <EMBED>, <IFRAME>, and <IMG>.
  • This tag requires the </OBJECT> end tag.
  • Some objects require extra <PARAM> tags between <OBJECT> and </OBJECT>.
  • To display a message for browsers that don't understand this tag, enter text between the <OBJECT> and </OBJECT> tags.
Attributes:
ACCESSKEY = "Text (single character)"
A character to use as a keyboard shortcut for selecting the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later Not supported

Notes:

  • The access key is invoked by using it as a key combination. For example, if you specify ACCESSKEY="P", then the user invokes the key by pressing Alt+P (Windows) or Cmd+P (Mac).

ALIGN = "Text"
The alignment of text that follows the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • Possible values: LEFT, RIGHT, TOP, TEXTTOP, MIDDLE, TEXTMIDDLE, BASELINE, BOTTOM, TEXTBOTTOM.
  • This attribute is deprecated.

BORDER = Postive integer
The thickness of the border that surrounds the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

CLASSID = "Text"
The URL or class identifier of the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • A class identifier is a 32-digit alphanumeric value that's unique to each object. These values are stored in the Windows Registry, so it's best to use an editor to insert such an object.
  • As an alternative, you can usually get away with specifying both the DATA attribute and the TYPE attribute.

CODE = "Text"
The URL of a .class file that contains the code for a Java applet object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported 4.0 and later Not supported

Notes:

  • Use a filename or a full URL.

CODEBASE = "Text"
The base URL used by the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

CODETYPE = "Text"
The content type of the object specified by CLASSID.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

DATA = "Text"
The URL of the object's data (such as an image file or a sound file).

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

  • Use a filename or a full URL.

DECLARE
Tells the browser that the specified object exists, but does not load the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

  • A subsequent tag actually loads the object by referring to the objects ID.

HEIGHT = Positive integer
The object's height, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

HSPACE = Positive integer
The horizontal space, in pixels, that is added to the left and right sides of the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

NAME = "Text"
The name of the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

STANDBY = "Text"
A message to display while the object loads.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

TABINDEX = Positive integer
The object's position with the page's tabbing order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

  • The "tabbing order" is the order in which page elements are selected when the user presses the Tab key.

TYPE = "Text"
The content type of the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later 4.0 and later

Notes:

USEMAP = "Text"
The image map coordinates (as specified by a <MAP> tag) to use with the image.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 3.0 and later Not supported

Notes:

  • The value of this attribute is the name of the image map (given by the <MAP> tag's NAME attribute), preceded by a number sign (#).

VSPACE = Positive integer
The vertical space, in pixels, that is added to the top and bottom of the object.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

Notes:

WIDTH = Positive integer
The object's width, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.2 and later 3.0 and later 4.0 and later

Example:
<OBJECT
   NAME="MyLabel"
   CLASSID="clsid:978C9E23-D4B0-11CE-BF2D-00AA003F40D0" 
   WIDTH=120
   HEIGHT=17>
<PARAM NAME="Caption" VALUE="This is an ActiveX label">
<PARAM NAME="SpecialEffect" VALUE="3">
Your browser doesn't suport the <OBJECT> tag. If it did, you'd see an ActiveX label here.
</OBJECT>
How It Looks:
Your browser doesn't suport the <OBJECT> tag. If it did, you'd see an ActiveX label here.

| Index | Previous Tag: <NOSCRIPT> | Next Tag: <OL> |