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:
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:
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:
The following optional attributes can be specified on a <meta> tag:
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 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:
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:
You can embed the style definitions into your page using the following tags:
The style definition is placed between the tags.
The following optional attributes can be specified on a <style> tag:
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:
The following attributes are deprecated but can still be used with the transitional DOCTYPE
The <link /> command can also be used for document specific toolbars, to link to a script, and to link to printable versions of documents.
This article written by Stephen Chapman, Felgall Pty Ltd.