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


SUB marks text that should be rendered as a subscript relative to the preceding text. The content of SUB may also be rendered in a smaller font, if possible. This is an unsafe element for browsers that do not support it, since subscripted text will be incorrectly presented by a browser that does not understand SUB. An example is

CaCO<SUB>3</SUB>

Note that SUB is not allowed inside PRE. SUB is supported by Netscape Navigator 3, Internet Explorer 3, and later.

SUP Element: Superscript

Can Be Inside: Not allowed inside PRE

SUP marks text that should be rendered as a superscript relative to the preceding text. The content of SUP may also be rendered in a smaller font, if possible. This is an unsafe element for browsers that do not support it, since superscripted text will be incorrectly presented by a browser that does not understand SUP. An example is:

x<SUP>2</SUP>

Note that SUP is not allowed inside PRE. SUP is supported by Netscape Navigator 3, Internet Explorer 3, and later.

TT Element: Fixed-Width Typewriter Font

TT marks a section to be rendered with a fixed-width typewriter font.

U Element: Underline

U marks a section to be rendered with an underline. This element is understood by some, but not all, browsers. Note that HTML 4 marks this element as deprecated, indicating that it is likely to be dropped in a future version of HTML. It should therefore be avoided as much as possible in new documents.

Phrase-Level Meta-Information Elements

Meta-information elements provide information used by the document, but not explicitly presented to the reader/user. The four relevant elements are: MAP and AREA, which provide imagemapping data used by client-side imagemaps; BASEFONT, which toggles default font characteristics; and SCRIPT, which includes a program script within an HTML document. Note that SCRIPTs that do not write any content into the document body should be placed in the HEAD. This element was thus described previously in this chapter in the HEAD element section.

BASEFONT Element: Set Default Font Characteristics

Usage: <BASEFONT>
Can Contain: empty
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH,
character highlighting, A, APPLET, BUTTON, IFRAME, LABEL, LEGEND, OBJECT
Attributes: COLOR, FACE, ID SIZE

BASEFONT specifies the default font characteristics—primarily font size—for all text following. However, it does not affect the size of text within heading elements or inside table cells. Internet Explorer also supports text color and font face control; these are not supported by other browsers. With Internet Explorer, BASEFONT-specified colors and faces override any settings set by BODY element attributes. In addition, BASEFONT has some odd behaviors under Internet Explorer 3/4: With this browser, BASEFONT does not affect the size of the text inside headings or tables, but it can change the font family (FACE) or color (COLOR) of the text inside these elements!

The attribute specifications are:

SIZE=“number” (optional) Specifies the default font size, as a value from 1 to 7 (the default is 3), relative to the “default” size on the browser. Note that BASEFONT does not affect the size of text inside heading elements.
COLOR=“#rrggbb,” “color” (optional; Internet Explorer only) Specifies the default text color, either as an RGB value or as a named color.FACE=“string” (optional; Internet Explorer only) Specifies the default font face for the document, either as a font name or as a sequence of comma-separated font names. The browser will try all fonts from left to right and will choose the first possible font.
BASEFONT should ideally appear prior to any displayed text in the BODY of the document. Localized changes to the font size should be implemented using SPAN and style sheets, as discussed in Chapter 7.

MAP Element: Client-Side Imagemap Database

Usage: <MAP> ... </MAP>
Can Contain: AREA
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH, character highlighting, A, APPLET, BUTTON, IFRAME, LABEL, LEGEND, OBJECTAttributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
NAME

A MAP element contains client-side imagemap mapping data. Each MAP must be uniquely identified by the NAME attribute: for example, <MAP NAME="map1">. The value for NAME is an arbitrary string. A map is then referenced from an IMG element using the USEMAP attribute, for example:

<IMG SRC="image.gif" .... USEMAP="#map1">

A single document can contain any number of MAP elements, each uniquely identified by a NAME. In principle, a MAP need not be in the same document as the IMG from which it is referenced, so that the above reference should also be possible via:

<IMG SRC="image.gif" ...  USEMAP="http://some.where.ca/maps/maps.html#map1">

where the file maps.html contains MAP elements used in several different documents. There are, however, no browsers that currently support such external MAP elements.

In addition to the mandatory NAME attribute, MAP also supports the standard “generic” and “event-handler” attributes described earlier in this chapter. Note that the event handlers are only partially supported by current browsers.A MAP element must contain AREA elements—these are the only elements allowed within a MAP. AREA elements mark out the regions of an image and the URLs to which these regions are linked, for example:

<MAP NAME="map1">
  <AREA SHAPE="rect" COORD="10,20,50,50" HREF="stuff.html">
  <AREA SHAPE="rect" COORD="30,40,60,60" HREF="otherstuff.html">
...
</MAP>

SHAPE and coordinate specifications are discussed in the next section.


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.