Every HTML document needs a title. This is not optional! It is required.
Keep in mind that, in most browsers, the content of the title element does not appear as a part of the page itself. It is usually displayed in the title bar of the browser window.
For example, the title of this document is Hypertext Markup Procedure. You should see this on the title bar of the browser window. It probably looks something like this:
The above images show what a typical title bar looks like in Netscape version 4.6 on Windows (top) and Macintosh (bottom). Keep in mind that titles will probably look different in other browsers, versions, and operating systems.
Notice, also, that these words do not appear in the page itself. The title of your document may appear in the body of your document, but it doesn't have to.
"Big deal!" you snort. "Who cares about that?"
But there is good reason to care, if you want your page to be as usable and as accessible as possible. This is because users often consult documents on the Web out of context. Many people use search engines and directories to find information on the Web, and these services usually list pages by their titles.
There is a certain art to writing a good, informative title for your page. It's a bit different than composing a title for a book or a poem or anything else.
Here's a sample of a title:
<HEAD> <TITLE>Mules and Men</TITLE> </HEAD>
As you can see, the title element is delimited by the <TITLE>
and </TITLE>
tags. The title element is nested within the head element.
But the title itself, while intriguing, does not provide much information as to what the page is about.
An improvement might be:
<HEAD> <TITLE>Mules and Men by Zora Neale Hurston</TITLE> </HEAD>
Now we've supplied the world with a little more context -- the author's name. But we can go further:
<HEAD> <TITLE>Mules and Men by Zora Neale Hurston: A Folklore Collection</TITLE> </HEAD>
Now the user has a lot more context. We know the name of the document and the author, and we have a sense of what it's about. Note also that it's OK to have a line break in the content of the element. It won't affect how the title is rendered.