|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
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 toplevel layer. The default width is the minimum size required to contain the element content. ZINDEX=number (optional) Specifies the zindex, or depthposition, for the layer relative to other layers within the same layer, with layers of larger zindex 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 siblingsthat 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 LayerIncapable Browsers
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 HTMLStyle 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 generalpurpose 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 subjectmy own HTML Stylesheet Sourcebook would, of course, be an excellent choice! Summary of Relevant Elements and AttributesStyle sheet support requires the following new HTML elements and attributes. The use of these new elements and attributes are discussed later in this section.
Style Sheets OverviewAs 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 displayssome 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 texttospeech 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 stylehow 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 authorside 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 longterm solutionthe 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 markedup 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, texttospeech, etc.) selecting the style information appropriate for its display format. As an example, a style sheet can contains instructions such as: H1 { fontsize: 24pt; fontfamily: arial; textalign: center; } H2 { fontsize: 18pt; fontfamily: arial; textalign: left; } EM { fontstyle: italic; } which says:
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 authorspecified 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.
|
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. |