HTML The Definitive Guide (132 page)

Read HTML The Definitive Guide Online

Authors: Chuck Musciano Bill Kennedy

BOOK: HTML The Definitive Guide
4.5Mb size Format: txt, pdf, ePub

13.2.4 The Tag

Use the tag to include a reference in your HTML document to some special plug-in application and perhaps data for that application. The standard analog for is the tag with the data attribute.


 

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 , reference the data object via the src attribute and URL value for download by the browser. The browser uses the MIME type of the src'd object to determine the plug-in required to process the object. Alternatively, you may also use the type attribute to specify a MIME type without an object, and thereby initiate execution of a plug-in application, if it exists on the user's computer.

Like all other tags, the nonstandard tag extension has a set of predefined attributes that define parameters and modify the tag's behavior. Unlike most other tags, however, the browsers let you include plug-in-specific name/value attribute pairs in that, instead of altering the action of the tag itself, get passed to the plug-in application for further processing.

For example, this tag:

has attributes that are processed by the tag (src, width, and height) and two that are not recognized, but rather passed to the plug-in associated with AVI video clips: autostart and loop.

It is not possible to document all the possible attributes that the many different plugins might need with their associated tag. Instead, you must turn to the plug-in developer to learn about all their required and optional attributes for each particular plug-in you plan to use in your pages.

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 tag's align, border, height, width, hspace, and vspace attributes let you control the appearance of that region exactly as they do for the tag, so we won't belabor them here.
[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 tag.

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: embeds an audio object in the page. The browser does not show anything to the user, but rather plays background music for the page. By contrast, the plug-in associated with:

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.

Other books

Words Left Unsaid by Missy Johnson
Alone on a Wide Wide Sea by Michael Morpurgo
Red Suits You by Nicholas Kaufman
Redemption by Eden Winters
Blind with Love by Becca Jameson

© FullEnglishBooks 2015 - 2024    Contact for me [email protected]