home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeHTML & XHTML: The Definitive GuideSearch this book

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.[6] The HTML and XHTML standards require an <html> tag for compliant documents, but most browsers can detect and properly display HTML encoding in a text document that's missing this outermost structural tag. Section 3.6.1, "The <html> Tag"

[6]XHTML documents also begin with the <html> tag, but with additional information to differentiate them from common HTML documents. See Chapter 16, "XHTML" for details.

Like our example, all HTML and XHTML documents have two main structures: a head and a body, 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 document's body content. Section 3.7.1, "The <head> Tag" Section 3.8.1, "The <body> Tag"

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. Standards require that every HTML and XHTML document have a title, even though the currently popular browsers don't enforce that rule. Choose a meaningful title, one that instantly tells the reader what the document is about. Enclose yours, as we do for the title of our example, 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. Section 3.7.2, "The <title> Tag"



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.