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 following optional attributes can be specified on a <head> tag:
- profile
- international
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.
The following optional attributes can be specified on a <title> tag:
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="generator" 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="classification" content=" " />
give an indication of what type of site it is - <meta name="distribution" content="Global" />
advises that your site is of interest globally. Other values indicate that the site has a more limited scope. - <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 - <meta http-equiv="reply-to" content=" " />
identify your email address in your document source - <meta name="language" content="English" />
identify the language that your document is in to some search engines - <meta name="revisit-after" content=" " />
tells some search engines when they should recatalogue your site - <meta name="expires" content=" " />
tells search engines when they should remove entries pointing to your site - <meta name="resource-type" content="document" />
- <meta name="doc-type" content="Web Page" />
- <meta name="doc-class" content="Completed" />
- <meta name="doc-rights" content="Copywritten Work" />
The following optional attributes can be specified on a <meta> tag:
- scheme
- international
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.
The following optional attributes can be specified on a <style> tag:
- media
- title
- xml:space="preserve"
- international
Alternatively, (and preferably) you can link to an external style sheet with the following:
<link rel="stylesheet" href="http://www.yoursite/style.css" type="text/css" />
The following optional attributes can be specified on the <link> tag:
- charset
- hreflang
- media
- rev
- core
- international
- event
The following attributes are deprecated but can still be used with the transitional DOCTYPE
- target
The <link /> command can also be used for document specific toolbars, to link to a script, and to link to printable versions of documents.


