XHTML Reference


go to previous section go to next section 

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:

go to top

 

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:

go to top

 

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:

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

go to top

 

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" />

go to top

 

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:

go to top

 

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:

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.

go to previous section go to next section 

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate