|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
<PRE> Type: Container Function: Denotes text to be treated as preformatted. Browsers render preformatted text in a fixed-width font. Whitespace characters, such as spaces, tabs, and carriage returns, found between the <PRE> and </PRE> tags are not ignored. This makes preformatted text a viable option for presenting tables of information. Syntax: <PRE WIDTH=width_of_widest_line> ... preformatted text goes here ... </PRE> Attributes: The <PRE> tags WIDTH attribute is set to the number of characters in the widest line of the preformatted text block. This information helps some browsers choose the font size for displaying the text. Use of the WIDTH attribute has been deprecated in HTML 4.0. Example: <PRE WIDTH=34> Catalog No. Item Price AZ-1390 Polo Shirt $29.99 FT-0081 Sweater $52.99 CL-9334 Belt $16.99 </PRE> <SPAN> Type: Container Function: Generic container tag for defining a document block. One popular use is for applying style information. Syntax: <SPAN STYLE=style information ALIGN=LEFT|RIGHT|CENTER|JUSTIFY> range of text over which style is to be applied </SPAN> Attributes: If youre assigning style information, you can set the STYLE attribute to a sequence of as many characteristic: value pairs as you need to specify the style information youre applying. Valid style characteristics are those put forward in the Cascading Style Sheets Level 2 specification. The ALIGN attribute can take on the customary values of LEFT, RIGHT, CENTER, and JUSTIFY. Example: <SPAN STYLE=font-weight: bold; color: red; text-indent: 0.25 in> Here is some bold, red, text thats indented by one quarter of an inch. </SPAN> List TagsTechnically, HTML lists are a form of block-level formatting, but because lists are such a useful way of presenting content, the list tags merit their own section in the chapter. HTML 4.0 continues to support five types of lists, although tags for two of the five have been deprecated. Using the tags in this section, you can create the following types of lists:
Most HTML lists make use of the list item tag, <LI>, so this tag is covered first, followed by the tags you use to create each type of list. <LI> Type: Container Function: Denotes an item in a list. Syntax: <LI TYPE=list_type START=start_value> ... list item goes here ... </LI> Attributes: The <LI> tag can take four attributes:
All the attributes listed above have been deprecated.
Example: <LI>Cookie Dough</LI> <LI>Rocky Road</LI> <LI>Mint Chocolate Chip</LI> Related Tags: The <LI> tag is always used in conjunction with one of the other HTML list tags: <DIR>, <MENU>, <OL>, and <UL>.
<DIR> Type: Container Function: Creates a directory listing. Items in a directory list are bulleted and generally shortusually not more than 20 characters in length. Originally, directory lists were intended for rendering narrow columns of information, such as indexes or telephone directory listings. The <DIR> tag has been deprecated by the W3C. You should use an unordered list (<UL>) instead. Syntax: <DIR COMPACT> <LI>List item 1</LI> <LI>List item 2</LI> ... </DIR> Attributes: The optional COMPACT attribute instructs a browser to reduce the spacing between list items so that the list is rendered in the smallest amount of vertical space possible. Example: <DIR> <LI>Mary Garrison, x521</LI> <LI>Tom Hinkle, x629</LI> <LI>Pat Joseph, x772</LI> </DIR> Related Tags: List items in a directory list are specified with the <LI> tag. <DL> Type: Container Function: Denotes a definition list (see Figure 3.12). Syntax: <DL COMPACT> ... terms and definitions go here ... </DL> Attributes: The COMPACT attribute is optional and enables you to compress the list into the smallest vertical space possible on the browser screen. Example: <DL> <DT>Browser</DT> <DD>A program that allow a user to view World Wide Web pages</DD> <DT>Server</DT> <DD>A program that fields requests for web pages</DD> </DL>
Related Tags: Terms in a definition list are specified with the <DT> tag, and their definitions are specified with the <DD> tag.
|
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. |