HTML and CSS Reference
In-Depth Information
All the text and HTML elements in your web page should be placed within the beginning
and ending HTML tags, like this:
<!DOCTYPE html>
<html>
...your page...
<
/html
>
The
<html>
tag serves as a container for all the tags that make up the page. It is required
because both XML and SGML specify that every document have a root element. Were
you to leave it out, which you shouldn't do because it would make your page invalid, the
browser would make up an
<html>
tag for you so that the page would make sense to its
HTML processor.
The
<head>
Tag
The
<head>
tag is a container for the tags that contain information about the page, rather
than information that will be displayed on the page. Generally, only a few tags are used
in the
<head>
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
<head>
tags).
Here's a typical example of how you properly use the
<head>
tag. (You'll learn about
<title>
later.)
4
<!DOCTYPE html>
<html>
<head>
<title>
This is the Title. It will be explained later on
</title>
</head>
...
your page
...
</html>
The
<body>
Tag
The content of your HTML page (represented in the following example as
...your
page...
) resides within the
<body>
tag. This includes all the text and other content
(links, pictures, and so on). In combination with the
<html>
and
<head>
tags, your page
will look something like this:
<!DOCTYPE html>
<html>
<head>
<title>
This is the Title. It will be explained later on
</title>
</head>
<body>
...your page...
</body>
</html>