HTML 3.2 and Netscape 3.0: The HEAD Element and Related Elements | WebReference

HTML 3.2 and Netscape 3.0: The HEAD Element and Related Elements

prevtopnext

The HEAD Element

HTML 3.2 and Netscape 3.0


The <HEAD> element in HTML 3.2 [Ra 95a] works identically to NHTML. Information in the <HEAD> element corresponds to the top part of a memo or e-mail message. It describes properties of the document such as the title, document toolbar, scripts, and meta information. The HEAD start and end tags are optional.

HEAD Elements

BASE
The BASE element defines an absolute URL that resolves relative URLs within the document. It is also useful if your document is downloaded or read out of context. Ex:

<BASE href="https://somewhere.com/index.html">
...
<IMG SRC="art/logo.jpg">

The image is deferenced to

https://somewhere.com/art/logo.jpg

Without the BASE element relative URLs are resolved to the document's URL.

ISINDEX
Used for simple keyword searches, and works with the PROMPT attribute. The ISINDEX element actually calls itself, so files with ISINDEX tags are usually scripts themselves. Ex:

<HEAD>
<ISINDEX PROMPT="Enter search string: ">
</HEAD>

LINK
The LINK element defines relationships between the document and other documents. It can be used to create tool bars, link to a style sheet (rev=stylesheet), a script (rev=script), or a printable version (like a pdf) of the document (rev=print) and embed authorship details. LINK should always be accompanied by an HREF to indicate the resource it refers to, the other attributes are optional. The LINK attributes are (from the HTML 3.2 DTD):
        id       SGML ID attribute
        href     URL for linked resource
        rel      forward link types
        rev      reverse link types
        title    advisory title string
Ex:

<LINK HREF="summary.html" TITLE="Summary" REV="Home">
<LINK HREF="chap4.html" TITLE="Color Palettes" REL="chapter">
<LINK HREF="mailto:[email protected]" TITLE="Andy King" REV="author">

META
The META element allows for including information about the document not defined by other elements. It is used to supply generic meta information using name/value pairs. The CONTENT attribute is required, with either the HTTP-EQUIV or NAME attribute to identify the type of action or data identifier to be associated with it.

Ex: (first example used for search engines, second shows currency of page)

<META Name="description" Content="Home page for webreference.com,
a Web site about creating Web sites. Learn the art of Web site creation.">

<META Name="keywords" Content="webreference.com, HTML,
frames, webmaster reference library, HTML reference, HTML authoring,...>

<META NAME="Last-Modified" CONTENT="8-26-96">

NHTML Ex: (after 10 seconds this page will refresh (move) to the "next" page)

<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=next.html">
</HEAD>
<BODY>
<P>...Mr. Phelps, this page will self destruct in 10 seconds...</P>

SCRIPT
The SCRIPT element is included as a placeholder for future use with script languages. It is already in use in the newest versions of Netscape and Explorer. Common practice is to surround the script proper with comments so older browsers don't see the script. Ex:

<SCRIPT LANGUAGE="JavaScript">

<!--// hide from other browsers

/* JavaScript Livepopup Navigator
   Generic arrays and select menus
   by Andy King ([email protected]) webreference.com
*/

function createArray() {
this.length = createArray.arguments.length
for (var i = 0; i this[i+1] = createArray.arguments[i]
}

var title = new createArray("Select a page...",
"Developer's Corner",
"Feature Articles",
...
// -->
</SCRIPT>

NHTML The SRC attribute to the SCRIPT tag allows hiding of scripts. Ex:

<SCRIPT LANGUAGE="JavaScript" SRC=mySource.js>

STYLE
The STYLE element is included as a placeholder for future use with style sheets.

TITLE
The <TITLE> element is not part of the body text, it is displayed in the window title. The <TITLE> element is required and should contain only text and no markup. Your title should be descriptive but short, less than 64 characters. The title should stand on its own when accessed directly. Ex:

<HTML>
<HEAD><TITLE>&nbsp;S&nbsp;Sc...</TITLE> or
<TITLE>Page 5 of report &#174; or <H1>BIG TEXT?</H1></TITLE>
</HEAD> - WRONG

<HTML>
<HEAD><TITLE>Include only descriptive text here, less than 64 characters</TITLE>
</HEAD> - RIGHT


nextprev

Comments are welcome

 


Revised: Aug. 25, 1996

URL: https://webreference.com/html3andns/head.html