The address for this web page is:

On to the next lesson!


Although the <TITLE> tag is the most common tag to include in the header (i.e., inside the <HEAD> </HEAD> container), there are two other tags that you should know about before tackling any big web project: the <BASE> and <META> tags.


THE <BASE> TAG (19a)

What is the <BASE> tag used for? The <BASE> tag is used to give the full URL for the current document. It's optional: if you use it, it goes inside the <HEAD> </HEAD> container. For example, the tag for the current document would look something like this:
Then, whenever a relative URL is encountered, the file name ("day_19_more_header_tags_nse.htm") is stripped away, and the remaining path is used as the base to get the absolute URL.
For example, if the tag <A HREF="graphics/pic_1.gif"> is encountered, the browser will actually request the absolute URL: 
If there is no BASE tag, then the URL used to access the document forms the base for the absolute URL (which is usually what you want). One use of the BASE tag is for large, multi-page documents (like this web course). If someone were to copy a single page of this course (without a BASE tag) to their hard drive and load it into a browser, none of the relative URLs would work. With the base tag, however, all the relative URLs are "turned into" the proper absolute URLs.
(The BASE tag is also useful when working with frames, and will be discussed in a future lesson.)

THE <META> TAG (19b)

What is the <META> tag used for? The primary use for the <META> tag is to include information about a document, such as its creation date, author, copyright information, and keywords. This information is used by servers, web browsers, and search engines, but is invisible to the reader. The <META> tag must go inside the <HEAD> </HEAD> container.
The NAME attribute specifies the type of meta information you're giving (like "author"); the CONTENT attribute then gives the actual value, like this:
<META NAME="author" CONTENT="Carol J.V. Fisher">
Some other typical NAME values are:
  • NAME="description": Give a brief description of the contents of your web page. Some search engines use only the first 20 words; get to the point quickly.
  • NAME="keywords": Give a list of comma-separated keywords that would be useful in indexing your web page.
  • NAME="generator": Give the name and version of the creation tool.

Printable version of Index Card 19a

Printable version of Index Card 19b



On to the next lesson!
© 2000 Carol J.V. Fisher    All Rights Reserved