|
|
|
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
|
Table 6.5 Meaning of User-Specified Attribute Value Assignments
|
#rrggbb
| Represents a color as an RGB (Red-Green-Blue) valuethis describes the color in terms of its of red, green, and blue components. Each color can be in the range 0255 (eight bits), and each color is referenced, in the RGB value, by its hexadecimal code. Thus the color red, which is full red (255), zero blue, and zero green, is coded as "#ff0000" , while white (all colors on full) is "#ffffff" . The default colors are determined by a browsers internal configuration. See also Appendix F on the companion Web site.
|
c
| Represents a single typeable character.
|
color
| Represents a named color. Several browsers support text strings to indicate particular colors. The commonly supported values are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. If a browser does not understand the color name, it will ignore the associated attribute and use the default color.
|
| Color names are not supported by early versions of Netscape Navigator or Internet Explorer (Version 2 or earlier). See also Appendix F on the Web site.
|
lang-code
| Represents a language code (e.g. fr-ca, or en-US) as defined in Appendix E on the companion Web site. This identifies the language used by the text inside the element.
|
mime-type
| A MIME type, for example: text/html. See also Appendix B on the Web site.
|
name
| Represents an arbitrary, user-defined name token stringa name token is a string of letters (az or AZ), digits (09), periods (.), or hyphens (-), and which must begin with a letter. Although such names are sometimes case-insensitive, it is safest to assume that they are case-sensitive (i.e., the name Fix23 is not equal to the name fix23).
|
names
| Represents an arbitrary, user-defined collection of name tokens, separated by spaces (e.g., name1 name2).
|
number
| Represents an arbitrary integer number.
|
pixels
| Represents an arbitrary integer number corresponding to a number of pixels, either horizontally or vertically.
|
real
| Represents a positive real number. Decimals (e.g., 2.3) are allowed, but not exponentials.
|
String
| Represents an arbitrary, user-defined text string.
|
Url
| Represents an arbitrary, user-defined URL.
|
|
Important Generic Attributes
HTML 4 introduces six generic attributes that are valid with almost all HTML body content (and some HEAD-level) elements. These attributes were introduced for four reasons: to provide mechanisms for linking HTML documents to formatting style sheets (CLASS, ID, STYLE); to add support for internationalizationthat is, documents that use multiple languages on the same page (DIR, LANG); to provide for more flexible hypertext linking between parts of a single document (ID); and to provide better tool-tip style help facility, for easier interface design and also as an aid to non-graphical browsers (TITLE).
This section describes the use and function of these attributes, while Figures 6.5 and 6.6 show the use of these attributes, in practice, to relate specific HTML elements to style sheet formatting rules (the struck-through and underlined text) and to provide tool-tip style help via the TITLE element. Table 6.6 summarizes the level of support for these attributes by Internet Explorer 4 and Netscape Navigator 4they are not supported by earlier versions of either browser.
- CLASS=string (optional) Specifies a subclass name for the element. Subclassing is used to define the special nature of an element, such as <DIV CLASS="introduction"> , <DIV CLASS="verse"> , and so on. Style sheets can bind to specific classes, so that an author can specify special formatting for different classes of the same element. This is discussed in Chapter 7. This functionality is provided by Netscape Navigator 4 and Internet Explorer 4.
- DIR=ltr, rtl (optional) DIR defines the direction in which the text inside the element should be drawn onto the display. There are two possible values: ltr for text that is drawn from left to right (e.g., English, French) and rtl for text that is drawn from right to left (e.g., Arabic, Hebrew). DIR can be used to override the intrinsic directionality of text as implied by the language (LANG attribute). At present, this attribute is only understood by the Tango Web browser from Alis Technologies (www.alis.com). Internationalized HTML is discussed in more detail in Chapter 7.
- ID=name (optional) Specifies a unique name token identifier for the element. Within a given document, no two elements can have the same ID value. In principle, ID-labeled elements can be the targets of hypertext links, as ID plays the same role as the NAME attribute of the anchor element. This aspect of ID is not supported by Netscape Navigator 4, but is supported by Internet Explorer 4. Style sheets can also reference IDs and can apply formatting instructions to specific ID-labeled elements. This aspect of ID is supported by Internet Explorer 4 and Netscape Navigator 4. Style sheets are discussed in more detail in Chapter 7.
- LANG=lang-code (optional) Specifies the language of enclosed text, using a well-defined language code, for example en-US for U.S. English, or fr-CA for Canadian French. See Appendix E on the companion Web site for details of language code specifications. At present, this attribute is only understood by the Tango Web browser from Alis Technologies (www.alis.com).
- STYLE=string (optional) Contains style sheet instructions that should be applied to the content of the element. This attribute is understood by Netscape Navigator 4 and Internet Explorer 3 and 4. Style sheets are discussed in more detail in Chapter 7.
- TITLE=string (optional) Specifies advisory or descriptive information about the associated element. This is a general-purpose equivalent to the ALT attribute of the IMG element, except that TITLE can annotate almost all HTML elements. For example, TITLE can be used, within an A element, to describe the resource targeted by the link. A browser might then, for example, use this text to produce a pop-up text description. This functionality is provided by Internet Explorer 4, but not by Netscape Navigator 4.
|