Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
13.2.4 The
Use the
Function:
Embed an object in a document
Attributes:
ALIGN
PLUGINSPAGE
BORDER
SRC
HEIGHT TYPE
HIDDEN UNITS
HSPACE
VSPACE
NAME WIDTH
PALETTE
End tag:
None
Contains:
Nothing
Used in:
text
With
Like all other tags, the nonstandard
For example, this tag:
It is not possible to document all the possible attributes that the many different plugins might need with their associated
13.2.4.1 The align, border, height, width, hspace, and vspace attributes
The browser invariably displays embedded objects to the user in a region set aside within the document window. The
[The Tag, 5.2.6]
Briefly, the height and width attributes control the size of the viewing region. Normally, you should specify the height and width in pixels, but you may also use some other units of measure if you also specify the units attribute (see section
Section 13.2.4.8, "The units attribute"). The
hspace and vspace attributes define a margin, in pixels, around the viewing region. The align attribute determines how the browser aligns the region within surrounding text, while the border attribute determines the width of the border surrounding the viewing region.
Only Netscape supports the align, border, hspace, and vspace attributes for the
13.2.4.2 The hidden attribute
The hidden attribute makes an object invisible to the user, forcing it to have a height and width of zero.
Note that setting hidden does not cause the browser to display an empty region within the document, but rather completely removes the object from the containing text flow.
This attribute is useful for audio streams placed within HTML documents. The HTML entry:
might present an audio control panel to users so that they might start and stop the audio playback, adjust the volume, and so forth.
13.2.4.3 The name attribute
Like other name attributes, this one also lets your label the embedded object for later reference by other elements in your document, including other objects. The value of the attribute is a character string.
13.2.4.4 The palette attribute
The palette attribute is supported by both Netscape and Internet Explorer, but in completely different ways. With Netscape, the value of the palette attribute is either foreground or background, indicating which palette of window system colors the plug-in uses for its display.
With Internet Explorer, the value of palette is instead a pair of hexadecimal color values, separated by a vertical bar. The first value determines the foreground color used by the plug-in; the second sets the background color. Thus, specifying this palette: palette=#ff0000|#00ff00
causes the plug-in to use red as its foreground color and green as its background color. For a complete description of hexadecimal color values, see
Appendix F, Color Names and Values
.
13.2.4.5 The pluginspage attribute
The pluginspage attribute, supported only by Netscape, specifies the URL of a web page that provides instruction on where to obtain and how to install the plug-in associated with the embedded object.
13.2.4.6 The src attribute
Like its document-referencing counterparts for a myriad of other tags, the src attribute supplies the URL
of the data object that you embed in the HTML document. The server providing the object must be configured so that it notifies the browser of the correct MIME type of the object. If not, the browser will use the suffix of the last element of the src value - the object's filename in the URL path - to determine the type of the object. The browser uses this MIME type to determine which plug-in it will execute to process the object.