Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


TYPE=“string” (optional) Specifies the MIME type of the data referenced by the DATA attribute. This is a hint to the browser—a browser can in principle use this information to avoid downloading data types it does not support. In practice, however, a browser cannot definitively know the type until the data are actually accessed.

CLASSID can reference the code to properly handle the indicated data type. If CLASSID is absent, then TYPE is used to select an appropriate data handler.

USEMAP=“string” (optional; not currently supported)Specifies the URL of a client–side imagemap MAP element, as described in Chapters 3 and 6. This gives OBJECT the same functionality as client–side imagemapped IMG elements.

VSPACE=“length” (optional) Specifies the desired vertical spacing to leave above and below the object, in pixels.

WIDTH=“length” (mandatory)Specifies the desired width of the box enclosing the object, in pixels. In principle, WIDTH can be used to rescale the object to the specified width. Whether or not this is possible depends on the object being embedded.

PARAM Element: Parameter Inside an OBJECT

Usage: <PARAM>
Can Contain: empty
Can be Inside: APPLET, OBJECT
Attributes: NAME, TYPE, VALUE, VALUETYPE

The advanced OBJECT model supports extra attributes to PARAM elements inside an OBJECT. VALUETYPE specifies the type of the string being assigned to VALUE, and can take the three possible values “data,” “object,” or “ref.” “Data” means that the VALUE string is data to be passed to the object, and that HTML entity and character references must be replaced by the referenced characters before the string is sent. The value “object” means that the assigned string is a reference pointing to another (possibly running) OBJECT within the same document. The value “ref” indicates that the value is a proper URL referencing a resource. If VALUETYPE=“ref,” then the optional TYPE attribute can be used to specify the MIME type of the referenced object.


NOTE: TYPE and VALUETYPE Not Widely Supported

At present, Microsoft Internet Explorer 3, the only browser to support OBJECT, does not support the TYPE and VALUETYPE attributes.


Netscape LAYER Elements

With Navigator 4, Netscape introduced three proprietary HTML elements: LAYER, ILAYER, and NOLAYER. These elements allow for layered content on the displayed page—that is, for content that appears “above” the standard page, rather like a “floating” block of text or graphic. In the Netscape approach, such floating content is defined by the LAYER or ILAYER elements (the two elements define the different ways in which elements can “float,” as discussed below), or within an external document referenced by a SRC attribute of a LAYER or ILAYER. The NOLAYER element was introduced as a container for markup to be displayed by browsers that do not understand LAYER elements. Thus, NOLAYER is similar in purpose to NOFRAMES, NOSCRIPT, and NOEMBED.

Just after Netscape introduced the layer elements, the World Wide Web Con–sortium introduced a style sheet approach for element positioning and z–indexing—that is, for elements positioned above the plane of the regular HTML document. This is equivalent to the functionality provided by layer elements, and is now the recommended mechanism for creating layers in HTML documents. At present, Netscape Navigator 4 supports both layer elements and CSS positioning, while Internet Explorer 4 and other browsers do not support LAYER elements—thus, you must use CSS if you wish your pages to work on non–Netscape browsers.

However, many Netscape (and other) documents are composed using the layer elements, so it is important to understand the elements and how they work. In addition, there are some aspects of the layer approach (for example, using SRC to reference external content for the layer) that are not possible with CSS.

LAYER and ILAYER: Absolutely and Relatively Positioned Layers

The different layers are defined by LAYER and ILAYER elements. A LAYER element defines an absolutely positioned layer—such layers are positioned independent of the location of the LAYER element within the HTML document. In addition, layers defined by LAYER do not affect the flow of the non–layered text in the rest of the document. Figure 7.24 shows one such layer, here consisting of the text “ABSOLUTE” in bold, light red (which appears, in this figure, as light gray) text. Note how, in Figure 7.25, this layer is physically positioned where it would have appeared if it had not been in a layer—this is simply the default placement for a positioned layer, should no specific position be specified. Note also that this layer does not affect the positioning of the other text in the paragraph—the regular document text continues underneath the layer, as if the layer were not present. Note that the background of the layer element is transparent, and the text of the underlying window shows through. This is the default behavior of a layer element. However, layer elements can be assigned background colors (BGCOLOR) or images (BACKGROUND), which are opaque and fully obscure the underlying content.

ILAYER, or inflow layer, defines relatively positioned content—such elements appear as part of the regular flow of the text, and are not separated from it. Figure 7.24 illustrates a simple example ILAYER element, here containing the single word “RELATIVE” in bold, light red text (light gray in the figure). Note how the text appears inline with the regular content, and the surrounding text is displaced from the region occupied by the layer.

Figures 7.24 and 7.25 illustrate the default positions of layers—that is, the positions occupied by the layers if no positioning information is given. Most of the time, layer elements are displaced to positions defined by the LEFT, TOP, PAGEX, or PAGEY attributes. Figure 7.26 illustrates this positioning, applied to the document in Figure 7.24—here, both elements are positioned to start at TOP=“50” and RIGHT=“50,” which define the position of the layers, relative to an upper left–hand corner, in pixels (percentage values are also supported).

The location of this upper left–hand corner depends on the type of the element, as illustrated in the browser rendering of this document in Figure 7.27—note the important difference between the resulting positions of the LAYER and ILAYER. The LAYER element is positioned 50 pixels down and 50 pixels in from the upper–left corner of the browser window, whereas the ILAYER element is positioned 50 pixels down and 50 pixels in from the position it occupied as an inline element. This illustrates the difference between absolute positioning of a LAYER—absolutely positioned relative to the enclosing frame and relative positioning of an ILAYER—positioned relative to the position the element would have if it were not positioned.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.