Useful and fun things to include in the HEAD of your documents.

The Head of a document is transfered first and separately from other parts of an HTML document. There are certain things which you can add in the Head of your documents which add functionality or avoid potential problems.

Documentation
A readable description of how to use HEAD elements can be found here.
In the documentation you'll find several Head elements not described here, such as LINK, SCRIPT, STYLE, etc. The latter two of these are not yet officially implemented.

BASE tag
The Base tag specifies the absolute location of an HTML document. For example:

<base href="http://www.itp.tsoa.nyu.edu/~boom/mtc.html">

The benefits of using this tag is that if you (or a user) views the source of a document out of context, i.e. off-line, you will know where to go to find the original. Also, if you specify a base URL, subsequent links in the same document can contain paths relative to the Base URL.

META tags
As the name suggests, META tags are used to include information about documents. A couple of common ways to use META tags are for client pull, and for defining keywords. The general syntax is as follows:

<META http-equiv="keywords" content="video,QuickTime,do-it-yourself"> <meta name="description" content="This is a web of pages featuring QuickTime movies created by Michael Cosaboom in the crude but effective style."> Where "http-equiv" is the equivalent of a server's HTTP response. Since the server only responds with basic messages such as the last modified date, and content type, you can use the http-equiv element to provide more detailed information such as: "keywords," "expires," "reply-to," or "Author." The "content" value is where you specify things like the specific keywords desired, your address, or a time value. Check the documentation for specifics about these different features.

A common way that these elements are useful is when a page of yours is indexed by a search engine, which will pull your chosen keywords from the head tags as you have specified them. These tags are particularly important for pages which don't have much text in them, such as documents which define FRAMESETs, and documents which contain mainly images, Shockwave movies, or Java applets. To clarify, if a search engine tries to index a page which contains only images, it will glean no infomation about the content of the page, but if you specify a "keywords" element in the HEAD, the search engine will come away with relevant information.

A common type of META tag is "refresh," which allows you to create a document which will instruct the browser to request a different document after a specified period of time. This is also called client pull.

Robots and indexing.
Sometimes you may have pages in your web which you don't want to be indexed by search engines. This could be a private set of pages created for personal reasons, or it could be a CGI script which generates temporary pages on-the-fly. In either of these cases you may want to use the ROBOTS meta tag, which could look something like this:

<META name="robots" content="noindex,nofollow"> For more detailed information about robots and how to deal with them, look here.
Building Web Sites - ITP Winter 1999 - Mike Cosaboom, Instructor
mc39@acf2.nyu.edu