Chapter 9. Document Structure

Before marking up your actual content, it is necessary to establish the proper global structure of the (X)HTML document itself. An (X)HTML document is composed of three parts: a declaration of the HTML or XHTML version used, a header containing information about the document, and the body containing the document’s content.[*] This chapter takes a look at each of these components and, in doing so, introduces these elements used for establishing the global structure of the document:

html

Root element of an (X)HTML document

head

Header

body

The body of the document

title

Document title

meta

Meta data (information about the document)

If you use a professional web authoring tool to create web pages, chances are you’re accustomed to the minimal document structural markup inserted for you when you select “New File.” This chapter will give you the tools necessary to peek under the hood and decide if the automatically generated declarations accurately represent the mode in which you intend to author.

[*] Not all documents have a body. Framed documents are composed of a declaration, header, and a frameset that establishes the number and structure of its frames. Framed documents are discussed in Chapter 14.

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.