ptg16476052
Structuring Your HTML 59
4
The tag serves as a container for all of the tags that make up the page. It is
required because both XML and SGML specify that every document have a root ele-
ment. Were you to leave it out, which you shouldn’t do because it would make your page
invalid, the browser would make up an tag for you so that the page would make
sense to its HTML processor.
The Tag
The
tag is a container for the tags that contain information about the page, ratherthan information that will be displayed on the page. Generally, only a few tags are used
in the portion of the page (most notably, the page title, described later). You
should never put any of the text of your page into the header (between tags).
Here’s a typical example of how you properly use the
tag. (You’ll learn about<!DOCTYPE html>
...your page...
The Tag
The content of your HTML page (represented in the following example as ...your
page...) resides within the
pictures, and so on). In combination with the and tags, your page will
look something like this:
<!DOCTYPE html>
...your page...
You might notice here that the tags are nested. That is, both
and tags goinside the tags; the same with both tags. All HTML tags work this way,