Setting Up an HTML Document
The standard skeletal structure of an HTML document is as follows:
<HTML> <HEAD><TITLE>Document Title</TITLE></HEAD> <BODY>Contents of Document</BODY> </HTML>
The HTML standard requires that the entire document appear within the
<html> container, however, most browsers can
properly display the contents of the document even if these tags are
omitted. All HTML documents are made up of two main structures, the
head (also called the “header”)
and the body. The exception to this rule is
when the document contains a frameset in place
of the body. For more information, see Chapter 11.
The Document Header
The header, delimited by the <head> tag,
contains information that describes the HTML document. The head tag
has no attributes of its own, but merely serves as a container for
other tags that help define and manage the document’s contents.
Titles
The most commonly used element within the header is the document
title (within <title> tags, as shown in the
example above), which provides a description of the page’s
contents. The title is also used as the name of the link as displayed
in a user’s bookmarks or “hot list.” Search engines
rely heavily on document titles as well. For all these reasons, it is
important to provide thoughtful and descriptive titles for all your
documents and avoid vague titles such as “Welcome,” or
“My Page.”
Other header elements
Other useful HTML elements are also placed within the
<head> tags of a document:
-
<base> This tag establishes the document’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access