XHTML Reference

Describing your document - the HEAD block

The HEAD tag

The head block is where you describe what your document is about. This information is contained within the following pair of tags <head> and </head>. This block always immediately follows the <html> tag.

Other information needed by the document prior to loading such as script and style information is also contained within the head block.

The TITLE tag

The document title is contained between the following two tags: <title> </title>. This title does not actually appear on your document but is displayed by the browser in the title bar of your window and is also used by search engines to identify the page.

META Commands

These commands provide more information about your document which is used by some search engines. The information (eg. copyright notice) may also be useful if people browse the source code of your document. The following are some of the meta commands that you might use:

<meta name="description" content=" " /> a short description of your site that will be displayed by search engines

<meta name="keywords" content=" " /> a list of keywords that some search engines will use to categorise your site

<meta name="editor" content=" " /> the editor that you used to create the page

<meta name="author" content=" " /> who created the page

<meta name="copyright" content=" " /> a copyright notice

<meta name="rating" content="General" /> rate your page as suitable for general viewing - there are different values to use for adult sites etc.

<meta name="robots" content="index,follow" /> advises some search engine robots/spiders whether or not they should catalog your page and/or follow the links that they find on your page

<meta http-equiv="pragma" content="no-cache" /> tell browsers not to cache your page so that it will always be re-downloaded from your site

The BASE statement

This statement defines an address that all links on the page will be relative to. This enables links to continue working even if someone copies the document to their hard drive. The format of the statement is:<base href="http://www.yoursite" />

Scripts

Scripts placed in the head section of your document will load (and execute if not contained within functions) before your page is displayed

The format for the script command is:<script type="text/javascript" src=" "> </script>the 'type' identifies the language that the script is written in (in this example Javascript) and the 'src' identifies the file that contains your script source.

Scripts can also be placed in the body of your page. In this case the script should consist of executable statements (functions are better defined in the head block).

The following optional attributes can be specified on a <script> tag:

charset

defer="defer"

xml:space="preserve"

Style sheets

You can embed the style definitions into your page using the following tags:<style type="text/css"> </style>The style definition is placed between the tags.