HTML: The Definitive Guide

Previous Chapter 2 Next
 

2.4 HTML Skeleton

Notice, too, in our simple example source that precedes Figure 2-1), the HTML document starts and ends with <html> and </html> tags. Of course, these tags tell the browser that the entire document is composed in HTML. The HTML standard requires an <html> tag for every HTML document, but most browsers can detect and properly display HTML encoding in a text document that's missing this outermost structural tag. [<html>, 3.5.1]

Inside, like our example, all HTML documents have two main structures: a head and a body,[2] each bounded in the source by respectively named start and end tags. You put information about the document in the head and the contents you want displayed in the browser's window inside the body. Except in rare cases, you'll spend most of your time working on your HTML document's body content. [<head>, 3.6.1] [<body>, 3.7.1]

[2] Actually, there's an alternate, nonstandard structure: Netscape ``frame'' documents, which divide the browser's main display into two or more independent windows, replaces the body with special tags that describe those frames. We describe frames later in this chapter and in detail in Chapter 10, Frames.

There are several different document header tags you may use to define how a particular document fits into a document collection and into the larger scheme of the Web. Some nonstandard header tags even animate your document.

For most documents, however, the important header element is the title. Every HTML document is required by the HTML standard to have a title. Choose a meaningful one; the title should instantly tell the reader what the document is about. Enclose yours, as we do our example's title, between the <title> and </title> tags in your document's header. The popular browsers typically display the title at the top of the document's window onscreen. [<title>, 3.6.2]


Previous Home Next
HTML Embedded Tags Book Index The Flesh on an HTML Document