HTML Tag Reference
Heading Tags
This section describes the tags that can go in the header of a document between the <HEAD> and </HEAD> tags. Additionally, the ISINDEX and SCRIPT tags can go in the header of a document, and these are discribed in other part of this document.
HREF="baseURL"
TITLE
(document title)
The TITLE tag specifies the title of the document. This title appears in the title bar of the browser window. In addition, automated web search tools can use the title to index documents. If no title is specified, the default title depends on the browser being used.
Syntax
<TITLE>...</TITLE>
Used within
HEAD
Example
<HTML>
<HEAD>
<TITLE>HTML Tag Reference</TITLE>
</HEAD>
BASE
(base URL)
The BASE tag specifies the base URL for the document. All relative links in the document are derived from this base URL. For example, if the base is "http://home.netscape.com/", the relative link "doc1.html" resolves to "http://home.netscape.com/doc1.html".
The BASE tag can also specify a base window which is used to display destination documents when the user clicks links in the document (unless the link itself specifies a target window).
When building complex, multi page documents, you might want to specify a base URL for the main document (master HTML file). To do this, establish a base URL, then give relative URLs for all referenced documents.
If you change the location of the master document, you must update the BASE tag to the new base URL. All relative references to URLs will be updated relative to the new location of the base URL.
If a document containing links to other documents in the same directory or a subdirectory does not specify a base URL, the full path to the linked documents will usually be resolved correctly. However, the browser may sometimes resolve relative links incorrectly unless the document containing the links specifies the BASE attribute.
The BASE tag does not require a closing tag.
Syntax
<BASE
The HREF attribute is required.
HREF="baseURL"
TARGET="WindowName"
>
specifies the location of the document. This value should be a full path name. All relative links in the document are resolved with respect to this base URL.
TARGET="windowName"
identifies the default window or frame to be used to display any documents that are opened by activativing links in this document. Navigator 2.0
Used within
HEADExample
This example sets"http://home.netscape.com/" as the base URL for the document.
<HEAD>
<BASE HREF="http://home.netscape.com/">
</HEAD>
<BODY>
<P>Information about Netscape and its products can be found at
<A HREF="comprod/index.html">Company & Products</A>.
META
(metadocument information)
The META tag specifies information about the document or creates an HTTP response header. The META tag has no effect on the appearance of the web page. It is intended for use by other programs, such as search engines or web browsers. If the NAME attribute is supplied, the META tag specifies information about the document. You can use the META tag to convey information about the page to search engines. For example, you could create a META tag that summarizes the content of the page and another one that lists the important concepts or keywords in the page. If the HTTP-EQUIV tag is supplied, the META tag creates an HTTP response header that can convey information to the browser about what to do with the file. For example, you can use the META tag to tell the browser how often to refresh the page. For example, you could specify that a web page that displays stock prices or late-breaking news updates automatically every five seconds without the user having to request it to update.Syntax
<META
NAME="name"
HTTP-EQUIV="FieldName"
CONTENT="value"
>
You must provide either the NAME or the HTTP-EQUIV attribute.
NAME="name"
specifies a name for the metadocument information. Different programs that access metadocument information expect different values for this attribute. Widely recognized names include:
<META NAME="description" CONTENT="Reference listing of HTML tags.">Keywords: Comma-separated keywords to be used by search engines to index your document in addition to words from the title and document body. For example:
<META NAME="keywords"Author : Usually the author's name.
CONTENT="HTML, tags, reference, attributes">
HTTP-EQUIV="FieldName"
specifies the name of the HTTP response header field. Widely recognized values include:
<META HTTP-EQUIV="expires" CONTENT="Sun, 28 Dec 1997 09:32:45 GMT">Refresh: Specifies a delay, in seconds, before the browser automatically reloads the document. Optionally, specifies an alternative URL to load. For example:
<META HTTP-EQUIV="Refresh" CONTENT="2;URL=http:nextdoc.html">Set-Cookie: Sets a cookie in Netscape Navigator. Values with an expiration date are considered permanent and are saved to disk on exit. For example:
<META HTTP-EQUIV="Set-Cookie"For more information about cookies in general and the set-cookie value, see
CONTENT="cookievalue=abc;expires=Friday, 31-Dec-99 23:59:59 GMT; path=/">http://www.netscape.com/newsref/std/cookie_spec.html.
CONTENT="FieldContent"
provides content information. Navigator 1.1.For more information about the META tag, see:
CONTENT="firstvalue;secondval=`a string';thirdval='another string';"
http://www.stars.com/Seminars/HTML/Head/meta.html
For details of many more values for the NAME and HTTP-EQUIV attributes, see:http://vancouver-webpages.com/META/
UsedWithin
HEADExample 1: Indexing Information
In this example, the META tag stores indexing information that a search engine can use when it accesses the document. Many search engines look for a META tag whose name is "keywords" and will catalog the keywords.<HEAD>
<TITLE>HTML Reference</TITLE>
<META NAME="keywords"
CONTENT="HTML, documentation, reference, Netscape">
</HEAD>
Any search engines that explore this page will index it under the terms HTML, documentation, reference, and Netscape.
Example 2: a Special HTTP Header
In this example, the META tag creates a special HTTP header field called "Creation_Date." The server returns this field when an HTTP connection for this document is established.<HEAD>
<META NAME="Creation_Date" CONTENT="July 17, 1997 19:24:00">
</HEAD>
This example creates the following HTTP header field:
Creation_Date: July 17, 1997 19:24:00
Example 3: Automatically Updating a Web Page
In this example, the META tag creates a special HTTP header field that implements a client pull animation. The animation shows three different views of a dog; these views, when loaded sequentially, simulate the dog running. The HTTP-EQUIV attribute is "refresh," which indicates that the page must be automatically refreshed. The CONTENT attribute specifies how long the page is displayed for before it is refreshed and also specifies which URL to display when it is time for the page to be refreshed. When a browser loadsspot1.html, the file is displayed for three seconds. Then the browser loads the second file, spot2.html. After three more seconds elapse, the browser loads the file spot3.html. This code is in a file called spot1.html:
<HEAD>
<TITLE>See Spot Run</TITLE>
<META HTTP-EQUIV="refresh"
CONTENT="3;URL='http://www.homepage.com/spot2.html'">
</HEAD>
<BODY>
<IMG SRC="spot1.gif">
</BODY>
The file "spot2.html" contains the following code:
<HEAD>
<TITLE>See Spot Run</TITLE>
<META HTTP-EQUIV="refresh"
CONTENT="3;URL='http://www.homepage.com/spot3.html'">
</HEAD>
<BODY>
<IMG SRC="spot2.gif">
</BODY>
Similarly, the file "spot3.html" contains the following code:
<HEAD>
<TITLE>See Spot Run</TITLE>
<META HTTP-EQUIV="refresh"
CONTENT="3;URL='http://www.homepage.com/spot1.html'">
</HEAD>
<BODY>
<IMG SRC="spot3.gif">
</BODY>
STYLE
(style definition)
The STYLE tag specifies a style sheet. Inside <STYLE> and </STYLE> you can specify styles for elements, define classes and IDs, and generally establish styles for use within the document. Navigator 4.0 Communicator 4.0 supports two types of style sheets: JavaScript style sheets and Cascading Style Sheets (CSS). To specify that the style sheet is JavaScript, the value of the TYPE attribute is "text/javascript". The default value of TYPE is CSS. It is beyond the scope of this reference to discuss style sheets in detail. For more information about the STYLE tag, see the section Defining Style Sheets with the <STYLE> Tag in Chapter 3-Creating Style Sheets and Assigning Styles in Dynamic HTML in Netscape Communicator.
TYPE="stylesheetType"
Syntax
<STYLE "stylesheetType"
TYPE=>
...
</STYLE>
specifies either a JavaScript style sheet or a cascading style sheet (CSS). The value can be "text/css" for cascading style sheets, or "text/javascript" for JavaScript style sheets.
Used Within
<HEAD> and </HEAD>.
Example 1. Cascading Style Sheet
<STYLE TYPE="text/css">
P {font-size:18pt; margin-left:20pt;}
H1 {color:blue;}
</STYLE>
Example 2. JavaScript Style Sheet
<STYLE TYPE = "text/javascript">
tags.P.fontSize = "18pt";
tags.P.marginLeft = "20pt";
tags.H1.color = "blue";
</STYLE>
LINK
(link to external files)
Use the LINK tag to link external files such as style sheets and downloadable fonts into your document. Navigator 4.0Syntax
<LINK
REL="fileType"
TYPE="type">
SRC="location"...
</LINK>
REL="fileType"
specifies the kind of file to be linked. For an external style sheet, the value is "stylesheet". For a downloadable font definition file, the value is "fontdef".
TYPE="type"
specifies more information about the particular type of file to be linked to, if that information is needed. For style sheets, the value can be "text/css" for cascading style sheets, or "text/javascript" for JavaScript style sheets.
SRC="location"
specifies the location of the file to be linked.
Example
<!-- link to an external style sheet -->
<LINK REL=STYLESHEET TYPE="text/css" SRC="styles/style1.html">
<!-- link to a font definition file -->
<LINK REL=FONTDEF SRC="http://home.netscape.com/fonts/sample.pfr">
[Contents] [Previous] [Next] [Alphabetical Tag List] [Index]
Last Updated: 01/26/98 21:33:44
