Chapter 5: Special Effect Tags | ||
|
Introduction to HTML, created in 1995 by Eric Meyer, is maintained on this server for historical reference. While much of this information is still relevant, it is important to remember that it was written for HTML 2.0. The more current versions of HTML and XHTML in use today have different requirements. To learn more, you may also wish to review our Web Development blog entries on HTML/XHTML and Cascading Style Sheets. |
||
|
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 TagsThe "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.
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 TagsThe 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:
Horizontal RulesThe 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.
|
||||