[  Home  ]
[  Introduction  ]
[  The Web  ]
[  HTML  ]
[  Bookmarks  ]
[  Word  ]
[  Excel  ]
[  Access  ]
[  Tori Amos  ]
[  Robert Heinlein  ]
[  Jeff  ]

You may recall that in Chapter 3, I made a point about using headings to emphasize text within a paragraph. (For those of you who missed it, the point was that you can't use headings that way.) I also promised to show you how to highlight text. That's what this chapter is about, among other things.

Logical Style Tags

The "correct" way to highlight text is to use the logical tags, which do not directly specify the type of highlighting they will employ. There are 'defaults' written into the specification (see the quotations below) but there is no direct rule about which tag should be displayed in what way. This is entirely in keeping with HTML's structural nature.

Emphasis
To quote from the HTML 2.0 specification, the <EM> and </EM> tags provide "typographic emphasis, typically italics."
Strong
Again from the specification, the <STRONG> and </STRONG> tags provide "strong typographic emphasis, typically bold."
Citation
<CITE> and </CITE> specify a citation; this includes information like book titles, references, and so on. The text is usually displayed using italics.

These tags are recommended for use because they leave the most control to the reader of a document. However, in the real world, the tags in the next section are a lot more popular than those above.

Forced Style Tags

The tags I will cover here are sometimes called forced style tags, because their very nature forces a certain style within the document (at least, that's the idea). This does run counter to the entire "HTML is purely structural" philosophy, but my advice is not to worry about it too much. As long as you use the logical style tags where appropriate, then you're fine.

The four most commonly used forced style tags are very simple:

Boldface
Everything between <B> and </B> is boldfaced.
Italics
Everything between <I> and </I> is italicized.
Underline
Everything between <U> and </U> should be underlined; however, see the note below.
Typewriter Text
Everything between <TT> and </TT> is in typewriter text (a monospaced font in most browsers). This is typically used for variable names, or to show snippets of HTML.
The HTML 2.0 Specification does allow the mixing of these styles, but does not require that a consistent appearance be maintained. In other words, different browsers will display combined styles differently. Some will pick one or the other style, others will not display either, and a few will simply crash.

In some browsers, especially Netscape up to 1.12/1.22, the underline tag is not recognized. This is because the underline tag is still being proposed for inclusion in the HTML specification. As of this writing, it was still not part of official HTML 2.0 but part of the 3.0 draft. Most browsers do support underlining, but be aware that you cannot count on this. If the word "underlined" in the explanation for Underline, above, is in fact not underlined, then your browser does not support the underline tag.

Horizontal Rules

The horizontal rule is a pretty useful effect. Horizontal rules are not allowed within headings. The tag, which is empty, is <HR>, and produces the following:


This is a quick, nearly painless way of throwing in a section divider. In the past, this effect could only be achieved using an in-line image, which just slows everything down (consider the difference in size and download time between a 1K graphic and four text characters).

There. That was pretty easy, wasn't it? Now that you have everything you need to arrange your text, it's time to start linking things together.

[  Go back  ] [  Go next  ]
© Copyright 1999 -- Jeffrey M. Johnson
Last Updated 10/8/99