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


WIDTH=“number,” “number%” (mandatory) Specifies the width of the layer. This can be an integer, which gives the width in pixels, a percentage, which gives the width as a percentage of the width of the parent layer, or a percentage of the window width if the attribute applies to a top–level layer. The default width is the minimum size required to contain the element content.

Z–INDEX=“number” (optional) Specifies the z–index, or “depth”–position, for the layer relative to other layers within the same layer, with layers of larger z–index value lying above layers with smaller values. This essentially defines the order in which the layers are stacked one above the other. Values must be positive integers. This relative positioning only applies to layers that are siblings—that is, that are contained within the same layer or that are contained directly within the same parent document as the current layer.

NOLAYER Elements: Content for Layer–Incapable Browsers

Usage: <NOLAYER> ... </NOLAYER>
Can Contain: ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV, DL, FIELDSET, FORM, Hn, HR, [ISINDEX], MENU, MULTICOL, NOEMBED, NOFRAMES, NOSCRIPT, OL, P, PRE, TABLE, UL,
characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, EMBED, IFRAME, IMG, INPUT, KEYGEN, LABEL, MAP, OBJECT, SCRIPT, SELECT, SPACER, TEXTAREA, WBR,
Can Contain: PARAM
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, MULTICOL, NOEMBED, NOFRAMES, NOSCRIPT, P, PRE, TD, TH
character highlighting, A, APPLET, BUTTON, IFRAME, LABEL, LEGEND, OBJECT
Attributes: none

NOLAYER is a container for content to be displayed by browsers that do not understand LAYER or ILAYER elements. Browsers that understand layer elements will hide all NOLAYER content.

Style Sheets and HTML

Style sheets are a mechanism for adding formatting and other typographic information to an HTML document, but in such a way that the HTML markup is largely unaffected. Style sheets are supported by HTML through the addition of two new elements and three new general–purpose attributes. This section describes the style sheet mechanism and how it is related to an HTML document. However, style sheets are complex, and this chapter does not cover all the details! If you are interested in knowing more about style sheets, you should consider purchasing a book on the subject—my own HTML Stylesheet Sourcebook would, of course, be an excellent choice!

Summary of Relevant Elements and Attributes

Style sheet support requires the following new HTML elements and attributes. The use of these new elements and attributes are discussed later in this section.

New HTML Elements STYLE and SPAN
New HTML Attributes CLASS, ID, STYLE
Attribute Function CLASS=“string” (optional)—Subclasses the element.
ID=“name” (optional) —Gives an element a unique name token identifier.
STYLE=“string” (optional) —Provides style sheet instructions for an element
Special Attribute REL=“stylesheet;” supported by LINK element
Special Attribute HTTP–EQUIV=“Content–style–type;” supported by META element

Style Sheets Overview

As mentioned throughout this book, HTML is a semantic markup language designed to describe the meaning and structure of a document and not the physical presentation. And, as noted repeatedly, there are many advantages to this approach. First, semantic markup adds information about the text, by explaining what the text is for (e.g., headings, figures, or paragraphs) or what the text means (e.g., block quotations, address, or emphasis). In addition, the language model allows for alternate information content, for presentation by nongraphical or nonvisual displays—some examples are the ALT attribute content of IMG elements or text contained within an APPLET. The net result is that carefully crafted HTML documents can, in principle, be presented by many different technologies, ranging from graphical displays to Braille readers to text–to–speech converters, with little loss of information content.

At the same time, no author wants to be limited to a semantic description alone. Authors and readers alike care how a document is presented or what it looks like, be it on paper, a computer display, or any other format. Each author or designer has preferred ways of representing things such as headings, quotations, or emphasis, as well as background colors or textures, graphics, and so on. These issues fall under the general category of style—how do the different parts of the document look or feel? To be a fully functional markup language, HTML must support a mechanism whereby authors (or readers!) can specify the styles they want applied to the written words.

Until recently, HTML largely ignored these issues. Browser software often gave the user limited control over the display (for example, users could select preferred background colors, font faces and sizes, and so on), while limited author–side control was possible through elements such as FONT or BASEFONT or through attributes such as ALIGN, BGCOLOR, and so on. However, using elements and attributes to specify formatting details is not a good long–term solution—the documents soon become big, cumbersome, and impossible to maintain, largely because HTML is simply the wrong place to specify the page layout descriptions required for detailed layout control.

The solution is to create a second mechanism for specifying formatting, separate from the markup. This is known as the style sheet approach and, in practice, involves a second document that contains instructions specifying how to format and display the elements of a given marked–up document. Since a style sheet is a separate piece of information, it can be maintained separately. Indeed, multiple, different style sheets can be written, with each display device (graphic display, printer, text–to–speech, etc.) selecting the style information appropriate for its display format.

As an example, a style sheet can contains instructions such as:

H1 { font–size: 24pt;    font–family: arial;  text–align: center; }
H2 { font–size: 18pt;    font–family: arial;  text–align: left; }
EM { font–style: italic; }

which says:

“Center H1 headings on the page and display them using 24 point Arial font”
“Left–align H2 headings and display them using 18 point Arial font”
“Format text inside EM using an italics version of the current font”

If a browser understands the style sheet mechanism, it takes an HTML document, accesses the associated style sheet information (mechanisms for finding this information are discussed later), and applies the style sheet instructions as it formats the document. This lets authors specify, through author–specified style sheets, the preferred formatting prescriptions for their documents. I use the word “preferred” because the browser, or the user, always has the option of ignoring the style information should it be inappropriate for some reason.


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.