|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
STYLE Element: Style Sheet or Rendering Information
STYLE contains style sheet rendering instructions to be applied to the document when displayed by the browser. STYLE allows rendering information to be placed within the document and not as a second file referenced through a LINK element. The latter may be accomplished using LINK elements of the form: <LINK REL=stylesheet HREF=http:some.where.dom/path/stylesheet TYPE=mime/type> where mime/type is the MIME type of the indicated style sheet (text/css for cascading style sheets). The STYLE element allows for browsers that do not support linked style sheets. In this instance, STYLE is best thought of as an interim mechanism for including style sheet information, as it has several disadvantages compared with linked style sheets. In particular, a linked style sheet can be shared between many documents, while the STYLE element forces every document to contain the style sheet data. However, STYLE has a second usefor local customization of an external style sheet. In this regard, you can use a linked style sheet to specify the broad details of the layout, with the content in the STYLE element providing small-scale, local modifications. The following is a simple STYLE example; styling mechanisms are discussed in more detail in Chapter 7. <HEAD> <STYLE> BODY { background: url(waves.gif) black; } H1 { margin-top: 10px; color: #4F; text-align: left; font: 30px Arial, gill, helvetica, sans-serif; } ... </STYLE> .... </HEAD><BODY> TITLE Element: Document Title
The title of a document is specified by the TITLE element. Every document must have a TITLE, and can only have one. The text inside a TITLE should indicate the document content in a concise but general way. A TITLE serves several purposes:
The TITLE is not part of the document text and cannot contain hypertext links or any other markup commandsit can contain only text, including entity or character references. The TITLE should be shortpreferably less than 60 charactersso that it can easily label a window or fit in a history list. You should be able to determine the content of the document from the TITLE itself. Otherwise, a person reviewing his/her bookmarks will see the title, but not know to what it refers. Here are some examples: Good TITLEs: <TITLE>Paper on Rings by Baggins and Gandalf, 1989</TITLE> <TITLE>Introduction to MIME types </TITLE> Bad TITLEs: <TITLE>Introduction</TITLE> <TITLE>A Summary of the Ring-Ring Interaction Cross-Section Measurement of B. Baggins, et al. in both Low-Temperature and High-Temperature Studies, including Water Immersion and Non-Destructive Testing: A Brief Review plus Commentary on the Missing Ring Problem.</TITLE> Block and Heading ElementsBlock elements divide a document into logical blocks of text, such as paragraphs (P), block quotations (BLOCKQUOTE), lists (see the following section), address information (ADDRESS), and so on. The block elements FORM, which defines a fill-in interactive form, and TABLE, which defines tabular structures, are more complex than the others and are described in detail later in this chapter. Several proprietary block-like elements, such as FRAMESET, FRAME, and IFRAME (Netscape frame documents), MULTICOL (multicolumn text), and NOBR (no line breaks), are supported by a number of browsers. These are described in Chapter 7. ADDRESS Element: Address Information
ADDRESS denotes information such as addresses, electronic signatures, lists of authors, and so on. Typically, document authors would use ADDRESS to sign his or her documents. In this case, the ADDRESS is often placed at the bottom of the HTML document to keep it separate from the main text. In a family of documents, the ADDRESS may contain just the authors initials or name connected by a hypertext link to a biographical page. Alternatively, a collection of documents may have an introductory document that has ADDRESS elements containing detailed contact information for the author or authors, with the remaining documents having ADDRESS elements containing hypertext links back to this page. As with all semantic markup elements, the rendering of the contents of ADDRESS is left up to the browser. By default, most browsers render ADDRESS content in italics. ADDRESS supports the standard generic and event-handler attributes described earlier in this chapter. Note that the event handlers are only partially supported by Internet Explorer 4 and are not supported by Netscape Navigator 4. Figures 6.7 and 6.9 show some typical applications of the ADDRESS element. Browser rendering of these documents are shown in Figures 6.8 and 6.10, respectively. Figure 6.7 HTML example document illustrating heading, BLOCKQUOTE, and ADDRESS elements. Figure 6.8 shows this document viewed by Internet Explorer 3. <HTML> <HEAD> <TITLE> Examples of ADDRESS and BLOCKQUOTE elements</TITLE> </HEAD> <BODY> <H1>The Meaning of Life </H1> <P> How many times have you sat down and asked yourself What is the meaning of life?. I certainly have. Ive even read many of the good books, from C.S. Lewis, to Kant, to Sartre to Zoltan the Magnificent. But I think the most profound statement about life was made by Jack Handey, who said: <BLOCKQUOTE> <P>I can still recall old Mister Barnslow getting out every morning and nailing a fresh load of tadpoles to that old board of his. Then hed spin it around and around, like a wheel of fortune, and no matter where it stopped hed yell out, Tadpoles! Tadpoles is a winner! We all thought he was crazy. But then, we had some growing up to do. </BLOCKQUOTE> <P>That pretty well sums it up. <HR> <ADDRESS> <A HREF=about_the_author.html> C.S.O </A> </ADDRESS> </BODY> </HTML>
|
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. |