Read HTML The Definitive Guide Online
Authors: Chuck Musciano Bill Kennedy
Even better, you can nest tags to enlarge the text. Each tag makes the text one size larger, up to a limit of size seven, as defined by the font model.
Be careful with your use of the tag, though. Because browsers are quite forgiving and try hard to understand a tag, those that don't support often interpret it to mean bold.
4.5.3 The Tag
The tag is like the content-based style tag. It and its necessary () end tag tell the browser to render the enclosed text in an italic or oblique typeface. If the typeface is not available to the browser, highlighting, reverse video, or underlining might be used.
4.5.4 The Tag
The tag works just like its counterpart (see previous description), except it decreases the size of text instead of increasing it. If the enclosed text is already at the smallest size supported by the font model, has no effect.
Like , you may also nest tags to sequentially shrink text. Each tag makes the text one size smaller than the containing tag, down to a limit of size one.
4.5.5 The Tag (Deprecated)
The tag is an abbreviated form of the tag supported by both Internet Explorer and Netscape. It is now a deprecated tag in HTML 4.0, meaning don't use it; it will eventually go away.
4.5.6 The Tag (Deprecated)Most browsers will put a line through ("strike through") text that appears inside the tag and its end tag. Presumably, it is an editing markup that tells the reader to ignore the text passage, reminiscent of the days before typewriter correction tape. You'll rarely, if ever, see the tag in use today, and probably never will: it is deprecated in HTML 4.0, just one version away from complete elimination from the standard.
4.5.7 The Tag
The text contained between the tag and its end tag gets displayed half a character's height lower, but in the same font and size as the current text flow. Both and its counterpart are useful for math equations and in scientific notation, as well as with chemical formulæ.
4.5.8 The Tag
The tag and its end tag superscripts the enclosed text; it gets displayed half a character's height higher, but in the same font and size as the current text flow. This tag is useful for adding footnotes to your documents, along with exponential values in equations. In combination with the tag, you can create nice, hyperlinked footnotes: The larval quat
weevil74 is a This example assumes that
footnotes.html
contains all your footnotes, appropriately delimited as named document fragments.
4.5.9 The Tag
In a manner like the and tags, the tag and necessary end tag direct the browser to display the enclosed text in a monospaced typeface. For those browsers that already use a monospaced typeface, this tag may make no discernible change in the presentation of the text.
4.5.10 The Tag (Deprecated)
This tag tells the browser to underline the text contained between the and the corresponding tag. The underlining technique is simplistic, drawing the line under spaces and punctuation as well as the text. This tag is deprecated in HTML 4.0 and will be eliminated in the next version of the standard. The same effect can be
achieved by using style sheets, covered in Chapter 9.
4.5.11 The
Text contained between the does just that: blink on and off. Netscape for Macintosh, for example, simply and reiteratively reverses the background and foreground colors for the
We cannot effectively reproduce the animated effect here in these static pages, but it is easy to imagine and probably best left to the imagination, too. That's because blinking text has two primary effects: it gets your reader's attention, and then promptly annoys them to no end. Blinking text should be used sparingly in any context.
4.5.12 The dir and lang Attributes
The dir attribute lets you advise the browser as to which direction the text within the physical tag ought to be displayed, and lang lets you specify the language used within the tag.
[The dir attribute, 3.5.1.1]
[The lang
4.5.13 The class, id, style, and title Attributes
Although each physical tag has a defined style, you can override that style by defining your own look for each tag. This new look can be applied to the physical tags using either the style or class
attributes. [Inline
Styles: The style Attribute, 9.1.1]
[Style Classes, 9.2.4]
You also may assign a unique id to the physical style tag, as well as a less-rigorous title, using the respective
attribute and accompanying quote-enclosed string value. [The id attribute, 4.1.1.4]
[The title attribute, 4.1.1.5]
4.5.14 Event Attributes
Like with content-based style tags, user-initiated mouse and keyboard events can happen in and around a physical style tags' contents. Many of these events are recognized by the browser if it conforms to the HTML
4.0 specification (none do fully), and with the respective "on" attribute and value, you may react to the event by displaying a user dialog box or activating some multimedia event.
[JavaScript Event Handlers, 13.3.3]
4.5.15 Summary of Physical Style Tags
The various graphical browsers render text inside the physical style tags in similar fashion.
Table 4.2
summarizes these browser's display styles for the native tags. Style sheet definitions may override these native display styles.
Table 4.2: Physical Style Tags
Tag
Meaning
Display Style
Bold contents
bold
Increased font size
bigger text
Alternating fore and background colors blinking text
Italic contents
Decreased font size
smaller text
, Strike-through text strike
Subscripted text
subscript
Superscripted text
superscript
Teletypewriter style
monospaced
Underlined contents
underlined
The following HTML source example illustrates some of the various physical tags as rendered by Netscape for
Figure 4.12
: Explicitly boldfaced, italicized, or teletype-style text should be used sparingly.
Otherwise, drink lots 1x106 drops of H2O.
Figure 4.12: Use physical text tags with caution
4.5.16 Allowed Content
Any physical style tag may contain any item allowed in
text
, including conventional text, anchors, images, and line breaks. You also can combine physical style tags with other content-based ones.
4.5.17 Allowed Usage
Any physical style tag may be used anywhere an item allowed in
text
can be used. In general, this means anywhere within a document except in the
4.5.18 Combining Physical Styles
You probably will have better luck, Dr. Frankenstein, combining physical tags than you might have combining content-based tags to achieve multiple effects. For instance, Netscape renders the following in bold and italic typeface: Thar she blows! In practice, other browsers may elect to ignore such nesting. The HTML 4.0 standard does require the browser to "do their best" to support every possible combination of styles, but does not define how the browser should handle such combinations. Although most browsers make a good attempt at doing so, do not assume that all combinations will be available to you.
4.4 Content-based Style Tags
4.6 Expanded Font Handling