Appendix B

HTML Language Reference


CONTENTS


The vast range of HTML markup currently supported by available HTML user agents (Web browsers, such as Netscape, Mosaic, and so on) can be broadly divided into the following sections. Some elements described may not be supported by all browsers. Where an element is known to be supported by specific browsers, the element description will be labelled as such.

This appendix is divided into the following sections:

Document Structure Elements
Anchor Element
Block Formatting Elements
Character Data
Document Sound
Dynamic Documents
Forms
Inline Images
Information-Type and Character-Formatting Elements
List Elements
Tables

Note
Stephen Le Hunte (cmlehunt@swan.ac.uk), the author of this appendix, is an independent software developer and freelance technical author specialising in HTML and WinHelp. He is currently studying for his Ph.D. at the University of Wales Swansea.

Document Structure Elements

These elements are required within an HTML document. Apart from the prologue document identifier, they represent the only HTML elements that are explicitly required for a document to conform to the standard.

The essential document structure elements are

<HTML>...</HTML>
<HEAD>...</HEAD>
<BODY>...</BODY>

Prologue Identifiers

In order to identify a document as HTML, each HTML document should start with the prologue:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">.

However, it is worth noting that if the document does not contain this type declaration, a browser should infer it. This document identifier identifies the document as conforming to the HTML 2.0 DTD.

<HTML>...</HTML>

The <HTML> element identifies the document as containing HTML elements. It should immediately follow the prologue document identifier, and it serves to surround all of the remaining text, including all other elements. Browsers use the presence of this element at the start of an HTML document to ensure that the document is actually HTML, according to the text/html MIME type. The document should be constructed like this:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
  The rest of the document should be placed here.
</HTML>

The HTML element is not visible upon browser rendering and can contain only the <HEAD> and <BODY> elements.

<HEAD>...</HEAD>

The <HEAD> element of an HTML document is used to provide information about the document. It requires the <TITLE> element between <HEAD> and </HEAD> tags:

<HEAD>
  <TITLE>Introduction to HTML</TITLE>
</HEAD>

The <HEAD> and </HEAD> tags do not directly affect the look of the document when rendered.

The following elements are related to the <HEAD> element. Although they don't directly affect the look of the document when rendered, you can use them to provide important information to the browser. To do so, you employ the following elements, all of which should be included within the <HTML>...</HTML> tags.

<BASE> Allows the base address of the HTML document to be specified
<ISINDEX> Allows keyword searching of the document
<LINK> Indicates relationships between documents
<META> Specifies document information usable by server/clients
<NEXTID> Creates unique document identifiers
<STYLE> Specifies styles within the document when used by browsers that support use of style sheets
<TITLE> Specifies the title of the document

Note
The <TITLE> element is the only element described here that is required as part of the <HEAD> of an HTML document for conformance to any HTML standard.

<BODY>...</BODY>

The <BODY> element of an HTML document, as its name suggests, contains all the text and images that make up the page, as well as all the HTML elements that provide the control and formatting of the page. The format is

<BODY>
  The rest of the document included here
</BODY>
The <BODY>...</BODY> tags should be directly enclosed within the <HTML>...</HTML> tags.

The <BODY> and </BODY> tags themselves do not directly affect the look of the document when rendered, but they are required in order for the document to conform to the specification standard. Various attributes of the opening <BODY> tag can be used to set up various page-formatting settings.

The capability to specify background images and colors for HTML documents was first implemented by Netscape and has since been implemented by most other browsers. It should be noted that the following elements might not be supported by every browser.

BACKGROUND

Recent versions of the proposed HTML 3.2 specification have added a BACKGROUND attribute to the <BODY> element. The purpose of this attribute is to specify a URL pointing to an image that is to be used as a background for the document. In most browsers, this background image is used to tile the full background of the document-viewing area. Consider the following code:

<BODY BACKGROUND="imagename.gif">
  Rest of the document goes here
</BODY>

It would cause whatever text, images, and so on that appeared in the body of the document to be placed on a background consisting of the imagename.gif graphics file, being tiled to cover the viewing area (like bitmaps are used for Windows wallpaper). Most browsers that support this attribute allow the use of GIF and JPG images for document backgrounds, whereas Internet Explorer supports those, plus Windows BMP files.

BGCOLOR

The BGCOLOR attribute for <BODY> is not currently in the proposed HTML 3.2 specification, but is supported by Netscape, the Internet Explorer, NCSA Mosaic, and many other browsers and is being considered for inclusion in HTML 3.2. It allows the setting of the color of the background without having to specify a separate image that requires another network access to load. The format is

<BODY BGCOLOR="#rrggbb">
  Rest of document goes here
</BODY>

where #rrggbb is a hexadecimal (base 16) red-green-blue triplet used to specify the background color.

Recently, browsers have begun allowing the use of special names to define certain colors. Appendix E, "Colors by Names," presents a list of all the color names recognized by popular browsers and also includes their corresponding hexadecimal triplet values.

Note that using color names is browser specific, so you have greater control over the displayed colors if you use the #rrggbb values instead.

If you change the background colors or patterns within a presentation, remember to verify that the foreground still looks good on the new background.

Color Considerations
Most graphical browsers allow the downloading of embedded images to be turned off to allow for faster downloading and display of the HTML document. If you turn off downloading for embedded images, background images will not be loaded or displayed. If this happens and no BGCOLOR attribute was specified, all of the foreground text and link-color attributes (TEXT, LINK, VLINK, and ALINK) will be ignored. This is so that documents are not rendered illegibly if the text color scheme authored for use over the set image clashes with the default browser background.

BGPROPERTIES

In Internet Explorer, you can watermark HTML documents by fixing a background image so that it doesn't scroll as a normal background image does. To give a page with a background image a watermarked background, add BGPROPERTIES=FIXED to the <BODY> element as this code shows:

<BODY BACKGROUND="filename.gif" BGPROPERTIES=FIXED>

LEFTMARGIN

This Internet Explorer attribute allows you to set the left margin of the document:

<BODY LEFTMARGIN="40">This document is indented 40 pixels from the left hand
edge of the browser window</BODY>

If you set LEFTMARGIN to 0, the page will start at the left-hand side of the page.

LINK, VLINK, and ALINK

These link attributes allow you to control the color of link text. VLINK stands for visited link, and ALINK stands for active link (this sets the color that the link text will be for the time that it is clicked on). Generally, the default colors of these attributes are LINK=blue (#0000FF), VLINK=purple (#800080), and ALINK=red (#FF0000). The format for these attributes is the same as that for BGCOLOR and TEXT:

<BODY LINK="#rrggbb" VLINK="#rrggbb" ALINK="#rrggbb">
  Rest of document goes here
</BODY>

You also can use color names rather than hexadecimal values for these attributes. See Appendix E for a complete list of color names and their hexadecimal values.

TEXT

The TEXT attribute can be used to control the color of all the normal text in the document. This basically consists of all text that is not specially colored to indicate a link. The format of TEXT is the same as that of BGCOLOR:

<BODY TEXT="#rrggbb">
  Rest of document goes here
</BODY>

You also can use color names rather than hexadecimal values for these attributes. See Appendix E for a complete list of color names and their hexadecimal values.

TOPMARGIN

This Internet Explorer-specific attribute allows the top margin of the document to be set:

<BODY TOPMARGIN="40">This document is indented 40 pixels from the top hand
edge of the browser window</BODY>

If you set TOPMARGIN to 0, the page will start at the very top of the page.

<BASE...>

The <BASE...> element allows you to set the URL of the document itself, to help browsers in situations where the document might be read out of context. It is especially useful in allowing browsers to determine any partial URLs or relative paths that might be specified (for example, in <A HREF> elements or in paths used to specify <IMG SRC=> (images)). The <BASE> element should appear within the bounds of the <HEAD> element only.

Where the base address is not specified, the browser uses the URL it used to access the document to resolve any relative URLs.

HREF

The <BASE> element has one standard attribute, HREF, that identifies the URL. The URL should be fully qualified, as in this example:

<BASE HREF="http://www.myhost.com/">

This code specifies www.myhost.com to be the base from which all relative URLs should be determined.

TARGET

Netscape 2.0 and Internet Explorer 3.0 add one other attribute to the <BASE> element. With the introduction of targeted windows, you can use the TARGET attribute as you use it in anchors (<A>). This allows you to pick a default-named target window for every link in a document that does not have an explicit TARGET attribute. Its format is

<BASE TARGET="default_target">

<ISINDEX...>

The <ISINDEX> element tells the browser that the document is an index document. As well as reading it, the reader can use a keyword search.

Readers can query the document with a keyword search by adding a question mark to the end of the document address, followed by a list of keywords separated by plus signs.

Note
The <ISINDEX> element usually is generated automatically by a server. If added manually to an HTML document, the browser assumes that the server can handle a search on the document. To use the <ISINDEX> element, the server must have a search engine that supports this element.

ACTION

Netscape provides the ACTION attribute for the <ISINDEX> element. When used in the <ISINDEX> element, it explicitly specifies the CGI script or program to which the text string in the input box should be passed. For example,

<ISINDEX ACTION="Websearch">

passes the text entered into the input box on the page to the CGI script Websearch.

Note
Websearch in the preceding example is a hypothetical CGI script. The ACTION attribute must point to a properly configured script on the host machine.

PROMPT

Netscape provides the PROMPT attribute for the <ISINDEX> element. PROMPT allows you to specify text that should be placed before the text-input field of the index. The syntax is

<ISINDEX PROMPT="Any_text_string: ">

where Any_text_string is the text you want to be displayed before the input box.

<LINK...>

The <LINK> element indicates a relationship between the document and some other object. A document may have any number of <LINK> elements.

The <LINK> element is empty (it does not have a closing element) but takes the same attributes as the Anchor element (for example, REL, REV, METHODS, TITLE, HREF, and so on).

The <LINK> element typically would be used to provide pointers to related indexes or glossaries. Links also can be used to indicate a static tree structure in which the document was authored by pointing to a parent, next, and previous document, for example.

Servers also may allow links to be added by those who do not have the right to alter the body of a document.

The <LINK> element represents one of the primary style sheet inclusion mechanism elements. It can be used to specify the location of the style sheet that is to be used for the document. For example:

<HTML>
<HEAD>
<TITLE>This HTML document uses a style sheet</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.stylesheets.com/sheets/formal.css" TITLE="formal">
</HEAD>
<BODY>
  Rest of the document goes here
</BODY>
</HTML>

In the preceding HTML fragment, the <LINK> element points to the file formal.css at the given URL. It tells the browser that

Note
This HTML fragment represents part of a work in progress specification of the World Wide Web Consortium (W3C).

For more information about these specific attributes, see the <A> section; for more general information about style sheets, see the style sheets section.

<NEXTID...>

The <NEXTID> element, included in old HTML specifications, is not widely supported and its use is not recommended. Previously, it could be used to provide information about the name of new <A> elements when a document was being edited.

<TITLE>...</TITLE>

Every HTML document must have a <TITLE> element. As its name suggests, it is used to specify the title of the document in question. Unlike headings, titles typically are not rendered in the text of a document itself. Normally, browsers will render the text contained within the <TITLE>...</TITLE> elements in the title bar of the browser window.

The <TITLE> element must occur within the head of the document and may not contain anchors, paragraph elements, or highlighting. Only one title is allowed in a document.

Note
Although the length of the text specified in the <TITLE>...</TITLE> elements is unlimited, for display reasons, most browsers will truncate it. For this reason, title text should be kept short but should be enough to uniquely identify the document. A short title such as Introduction may be meaningless out of context, for example, but if the title were An Introduction to HTML elements, it would be obvious what the document is about.

This is the only element that is required within the <HEAD> element.

<HEAD>
  <TITLE>Welcome to the HTML Reference</TITLE>
</HEAD>

<META...>

The <META> element is used within the <HEAD> element to embed document metainformation not defined by other HTML elements. Such information can be extracted by servers/clients for use in identifying, indexing, and cataloging specialized document metainformation.

Although it generally is preferable to use named elements that have well-defined semantics for each type of metainformation, such as title, this element is provided for situations where strict SGML parsing is necessary and the local DTD is not extensible.

In addition, HTTP servers can read the content of the document head to generate response headers corresponding to any elements defining a value for the attribute HTTP-EQUIV. This gives document authors a mechanism (not necessarily the preferred one) for identifying information that should be included in the response headers for an HTTP request.

Attributes of the <META> element are listed in the following sections.

CONTENT

The metainformation content to be associated with the given name and/or HTTP response header.

If the document contains

<META HTTP-EQUIV="Expires" CONTENT="Sat, 06 Jan 1990 00:00:01 GMT">
<META HTTP-EQUIV="From" CONTENT="nick@htmlib.com">
<META HTTP-EQUIV="Reply-to" CONTENT="stephen@htmlib.com"

the HTTP response header would be

Expires: Sat, 06 Jan 1990 00:00:01 GMT
From: nick@htmlib.com
Reply-to: stephen@htmlib.com

Commonly, HTML documents can be seen to contain a listing of repeated terms. Some Web search/indexing engines use the keywords information generated from the server or from those specified in the <META HTTP-EQUIV="Keywords" CONTENT="..."> markup to determine the content of the specified document and to calculate their relevance rating (how relevant the document is to the specific search string) for the search results.

When the HTTP-EQUIV attribute is not present, the server should not generate an HTTP response header for this metainformation. For example,

<META NAME="IndexType" CONTENT="Service">

Do not use the <META> element to define information that should be associated with an existing HTML element.

The following is an inappropriate use of the <META> element:

<META NAME="Title" CONTENT="Welcome to the HTML Reference">

Do not name an HTTP-EQUIV equal to a responsive header that typically should be generated only by the HTTP server. Some inappropriate names are Server, Date, and Last-modified. Whether a name is inappropriate depends on the particular server implementation. It is recommended that servers ignore any <META> elements that specify HTTP-equivalents (that are not case sensitive) equal to their own reserved response headers.

The <META> element is particularly useful for constructing dynamic documents via the client pull mechanism. This uses the following syntax:

<META HTTP-EQUIV="Refresh" CONTENT="x">

This causes the browser to believe that the HTTP response when the document was retrieved from the server included the following header:

Refresh: x

It also causes the document to be reloaded in x seconds.

Note
In the preceding example, when the document refreshes, loading itself, the browser will infinitely reload the same document over and over. The only way out of this situation is for the user to activate some hyperlink on the page, load a different document, or click the Back button to reload a previous document.

This can be useful to provide automatic redirection of browsers. If the element is

<META HTTP-EQUIV="Refresh" CONTENT="2; URL=http://some.site.com/otherfile.html">

the Refresh directive would cause the file at http://some.site.com/otherfile.html to be loaded after two seconds. Although this generally works if the URL specified is partial, you should use a fully qualified URL to ensure its proper functioning.

HTTP-EQUIV

This attribute binds the element to an HTTP response header. If the semantics of the HTTP response header named by this attribute is known, then the contents can be processed based on a well-defined syntactic mapping whether or not the DTD includes anything about it. HTTP header names are not case sensitive. If not present, the NAME attribute should be used to identify this meta-information, and it should not be used within an HTTP response header.

NAME

Metainformation name. If the NAME attribute is not present, the name can be assumed to be equal to the value HTTP-EQUIV.

Anchor Element

The anchor text is probably the single most useful HTML element. It is the element that is used to denote hyperlinks-the entire essence of HTML as a hypertext application.

<A...>...</A>

Anchor elements are defined by the <A> element. The <A> element accepts several attributes, but either the NAME or HREF attribute is required.

Attributes of the <A> element are decribed in the following sections.

HREF

If the HREF (hypertext reference) attribute is present, the text between the opening and closing anchor elements becomes a hypertext link. If this hypertext is selected by readers, they are moved to another document or to a different location in the current document whose network address is defined by the value of the HREF attribute. Typically, hyperlinks specified using this element would be rendered in underlined blue text, unless the LINK attribute of the <BODY> element has been spe-cified.

In this example, selecting the text HTMLib takes the reader to a document located at http://www.htmlib.com:

See <A HREF="http://www.htmlib.com/">HTMLib</A> for more information about the
HTML Reference.

With the HREF attribute, the form HREF="#identifier" can refer to another anchor in the same document or to a fragment of another document that has been specified using the NAME attribute.

In this example, &lt; and &gt; are character data elements that render as < and >, respectively. In this case, they are used so that <PRE> is actually rendered on-screen (so that the browser doesn't think that the following text is preformatted text).

The <A HREF="document.html#pre">&lt;PRE&gt;</A> provides details about the
preformatted text element.

Selecting the link takes the reader to another anchor (that is, <A NAME="pre">&lt;PRE&gt;</A>) in a different document (document.html). If the anchor is in another document, the HREF attribute may be relative to the document's address or the specified base address, or it can be a fully qualified URL.

Table B.1. Several other forms of the HREF attribute permitted by browsers.

<A HREF="http://..."> Makes a link to another document located on a World Wide Web server.
<A HREF="ftp://..."> Makes a link to an FTP site. Within an HTML document, normally a connection to an anonymous FTP site would be made. Some browsers, however, allow connections to private FTP sites. In this case, the anchor should take the form ftp://lehunte@htmlib.com and the browser then prompts the user for a password for entry to the site.
<A HREF="gopher://...­> Makes a link to a Gopher server.
<A HREF="mailto:..."> Activating such a link brings up the browser's mailing dialog box (if it has mailing capabilities; otherwise, whatever default e-mail software is installed on the system should be activated), allowing the user to send mail messages to the author of the document, or whoever's address is specified in the mailto: attribute. NCSA Mosaic supports use of the TITLE attribute for the anchor element when used with mailto: links. It allows the author to specify the subject of the mail message that will be sent. Netscape allows specification of the subject line by using the following syntax:
<A HREF="mailto:lehunte@htmlib.com?subject=The HTML Reference is fantastic"> link text</A>
<A HREF="news:..."> Makes a link to a Usenet newsgroup. Care should be taken in using such links because the author cannot know what newsgroups are carried by the local news server of the user.
<A HREF="newsrc:..."> Makes a link to a specific newsrc file. The newsrc file is used by Usenet news reading software to determine what groups carried by the news server the reader subscribes to.
<A HREF="nntp://..."> Specifies a different news server to that which the user may normally use.
<A HREF="telnet://..."> Activating such a link initiates a Telnet session (using an external application) to the machine specified after the telnet:// label.
<A HREF="wais://..."> Makes a link that connects to a specified WAIS index server.

METHODS

The METHODS attributes of anchors and links provide information about the functions the user may perform on an object. These are more accurately given by the HTTP protocol when it is used, but it may be useful to include the information in advance in the link. For example, the browser may chose a different rendering as a function of the methods allowed-something that is searchable may get a different icon or link text display method.

The value of the METHODS attribute is a comma-separated list of HTTP methods supported by the object for public use.

NAME

If present, the NAME attribute allows the anchor to be the target of a link. The value of the NAME attribute is an identifier for the anchor, which may be any arbitrary string but must be unique within the HTML document.

<A NAME="pre">&lt;PRE&gt;</A> gives information about...

Another document then can make a reference explicitly to this anchor by putting the identifier after the address, separated by a hash sign:

<A HREF="document.html#pre">

REL

The REL attribute gives the relationship(s) described by the hypertext link from the anchor to the target. The value is a comma-separated list of relationship values, which will have been registered by the HTML registration authority. The REL attribute is used only when the HREF attribute is present.

REV

The REV attribute is the same as the REL attribute, but the semantics of the link type are in the reverse direction. A link from A to B with REL="X" expresses the same relationship as a link from B to A with REV="X". An anchor may have both REL and REV attributes.

TARGET

With the advent of frame page formatting, browser windows now can have names associated with them. Links in any window can refer to another window by name. When you click on the link, the document you asked for appears in that named window. If the window is not already open, Netscape opens and names a new window for you.

The syntax for the targeted windows is

<A HREF="download.html" TARGET="reference">Download information</A>

This loads the document download.html in the frame that has been designated as having the name reference. If no frame has this name, Netscape opens a new browser window to display the document.

Note
The use of targeted browser windows is supported by those browsers that currently support the use of <FRAME> page layout (Netscape and Internet Explorer). If the targetted document is part of a frameset, various reserved names can be used to allow smooth window transition. For more information, see <FRAMES>.

TITLE

The TITLE attribute is informational only. If present, the TITLE attribute should provide the title of the document whose address is given by the HREF attribute.

This might be useful because it allows the browser to display the title of the document being loaded as retrieval starts-providing information before the new document can be viewed. It is up to individual browsers to specify how they display the title information, but usually it is displayed in the title bar of the browser window. Some documents (such as Gopher or FTP directory listings) do not themselves contain title information within the document. The TITLE attribute can be used to provide a title to such documents. As mentioned earlier, Mosaic supports use of the TITLE attribute to specify the subject of a mail message sent when the user activates a <A HREF="mailto:..."> link.

URN

If present, the URN attribute specifies a uniform resource name (URN) for a target document. The precise specification for URN has not yet been defined, so its use is not recommended.

Block Formatting Elements

Block formatting elements are used for the formatting of whole blocks of text within an HTML document (instead of single characters). They should all (if present) be within the body of the document (that is, within the <BODY>...</BODY> elements).

The essential block formatting elements follow:

<ADDRESS>...</ADDRESS> Formats an address section
<BASEFONT SIZE=...> Specifies the default font size for the document
<BLOCKQUOTE>...</BLOCKQUOTE> Quotes text from another source
<BR> Forces a line break
<CENTER>...</CENTER> Centers text on the page
<COMMENT>...</COMMENT> Encloses text as a comment
<DFN>...</DFN> Defines an instance
<DIV>...</DIV> Allows centering or left/right justification of text
<FONT ...>...</FONT> Sets/changes the font size, color, and type
<HR> Renders a sizeable hard line on the page
<Hx>...</Hx> Formats six levels of heading
<LISTING>...</LISTING> Formats text
<MARQUEE> Highlights scrolling text
<NOBR> Specifies that words aren't to be broken
<P>...</P> Specifies what text constitutes a paragraph and its alignment
<PLAINTEXT> Formats text
<PRE>...</PRE> Uses text already formatted
<WBR> Specifies that a word is to be broken if necessary
<XMP>...</XMP> Formats text

<ADDRESS>...</ADDRESS>

As its name suggests, the <ADDRESS>...</ADDRESS> element can be used to denote information such as addresses, authorship credits, and so on.

Typically, an address is rendered in an italic typeface and may be indented, although the actual implementation is at the discretion of the browser. The <ADDRESS> element implies a paragraph break before and after, as shown in this code:

<ADDRESS>
Mr. Cosmic Kumquat<BR>
SSL Trusters Inc.<BR>
1234 Squeamish Ossifrage Road<BR>
Anywhere<BR>
NY 12345<BR>
U.S.A.
</ADDRESS>

<BASEFONT ...>

Changes the size of the <BASEFONT>, on which all relative <FONT SIZE=+...> changes are based. It defaults to 3 and has a valid range of 1-7.

<BASEFONT SIZE=5>

FACE

Changes the face of the HTML document <BASEFONT>, exactly as it works for <FONT FACE= ...>.

Note
This attribute is Internet Explorer specific.

COLOR

Allows the <BASEFONT> color for the HTML document to be set. Colors can be set by using one of the reserved color names or as an rrggbb hexadecimal triplet value.

Note
The <BASEFONT SIZE=...> element is supported only by Netscape and the Internet Explorer, with the ...FACE and ...COLOR attributes being Internet Explorer specific. This kind of presentation markup also can be specified within a style sheet.

<BLOCKQUOTE>...</BLOCKQUOTE>

The <BLOCKQUOTE> element can be used to contain text quoted from another source.

Typically, <BLOCKQUOTE> rendering would be a slight extra left and right indent, and possibly rendered in an italic font. The <BLOCKQUOTE> element causes a paragraph break and provides space above and below the quotation.

In "Hard Drive", a former Microsoft project manager has said,
<BLOCKQUOTE>
"Imagine an extremely smart, billionaire genius who is 14 years old and subject to temper tantrums"
</BLOCKQUOTE>

<BR>

The line break element specifies that a new line must be started at the given point. The amount of line space used is dependent on the particular browser, but is generally the same as it would use when wrapping a paragraph of text over multiple lines.

Note
Some browsers may collapse repeated <BR> elements and render as if only one had been inserted, as shown in this example:
<P>
Mary had a little lamb<BR>
Its fleece was white as snow<BR>
Everywhere that Mary went<BR>
She was followed by a little lamb.

With the addition of floating images (an embedded image aligned to the left or right of the browser display window, with text flowing around the image), it became necessary to expand the <BR> element. Normal <BR> still just inserts a line break. A CLEAR attribute was added to <BR>, so

CLEAR=left will break the line and move vertically down until you have a clear left margin (where there are no floating images).
CLEAR=right does the same for the right margin.
CLEAR=all moves down until both margins are clear of images.

The CLEAR attribute (as well as floating images) currently are supported only by Netscape and the Internet Explorer.

<CENTER>

All lines of text between the begin and end of the <CENTER> element are centered between the current left and right margins. This element was introduced by the Netscape authors because it was claimed that using <P ALIGN=­CENTER­> "broke" existing browsers when the <P> element was used as a container (that is, with a closing </P> element).

The element is used as shown here, and any block of text (including any other HTML elements) can be enclosed between the centering elements:

<CENTER>All this text would be centered in the page</CENTER>

Note
Most browsers will internally work around this element to produce the desired format, but it is an element introduced by Netscape authors.

<COMMENT>...</COMMENT>

The <COMMENT> element can be used to comment out text. As such, it is similar to the <!-- ... --> element.

Any text placed between the <COMMENT> and </COMMENT> elements will not render on-screen, allowing comments to be placed in HTML documents. For example,

<COMMENT>This text won't render. I can say what I like here, it won't appear
</COMMENT>

would not render on-screen.

Note
This element is supported only by Internet Explorer and Mosaic.

<DFN>...</DFN>

Use of the <DFN> element currently is supported only by Internet Explorer.

The <DFN> element can be used to mark the defining instance of a term-for example, the first time some text is mentioned in a paragraph.

Typically, it will render italicized.

The <DFN>Internet Explorer</DFN> is Microsoft's Web browser.

for example, renders as

The Internet Explorer is Microsoft's Web browser.

<DIV>...</DIV>

Note
Use of the <DIV> element currently is supported only by Netscape (after version 2.0).

The <DIV> element, as described in the HTML 3.2 specification, should be used with a CLASS attribute to name a section of text as being of a certain style as specified in a style sheet. Netscape has implemented the <DIV> element to work as the <P ALIGN= ...> element. Essentially, text surrounded by the <DIV>...</DIV> elements is formatted according to the description attached to the ALIGN attribute within the <DIV> elements, as shown in this example:

<DIV ALIGN="left">This text will be displayed left aligned in the browser
window.</DIV>
<DIV ALIGN="center">This text will be centered.</DIV>
<DIV ALIGN="right">This text will be displayed aligned to the right of the
browser window.</DIV>

<FONT ...>

Netscape 1.0 (and above) and Microsoft's Internet Explorer support different-sized fonts within HTML documents. This should be distinguished from headings.

The element is <FONT SIZE=value>. Valid values range from 1-7. The default FONT size is 3. The value given to SIZE optionally can have a + or - character in front of it to specify that it is relative to the document <BASEFONT>. The default <BASEFONT SIZE= ...> is 3 and is specified with the <BASEFONT SIZE ...> element.

<FONT SIZE=4>changes the font size to 4</FONT>
<FONT SIZE=+2>changes the font size to BASEFONT SIZE ... + 2</FONT>

Note
The <FONT SIZE=...> element currently is supported only by Netscape and Internet Explorer.

Microsoft's Internet Explorer supports the capability to change the font color as well as the typeface. It adds COLOR and FACE attributes to the <FONT> element. Netscape supports the use of the COLOR attribute only.

COLOR = #rrggbb or COLOR = color

The COLOR attribute sets the color that text appears on-screen. #rrggbb is a hexadecimal color denoting an RGB color value. Alternatively, the color can be set to one of the available predefined colors. These color names can be used for the BGCOLOR, TEXT, LINK, ALINK, and VLINK attributes of the <BODY> tag as well.

<FONT COLOR="#ff0000">This text is red.</FONT>

or

<FONT COLOR="Red">This text is also red.</FONT>

Note
The use of names for coloring text currently is supported only by the Microsoft Internet Explorer and Netscape. Also, it should be noted that HTML attributes of this kind (that format the presentation of the content) also can be controlled via the use of style sheets.

FACE=name [,name] [,name]

The FACE attribute sets the typeface used to display the text on-screen. The typeface displayed already must be installed on the user's computer. Substitute typefaces can be specified in case the chosen typeface is not installed on the user's computer. If no exact font match can be found, the text is displayed in the default type that the browser uses for displaying normal text.

<, Comic Sans MS"> This text will be displayed in either Courier New, or Comic Sans MS, depending on which fonts are installed on the browser's system. It will use the default 'normal' font if neither is installed.
</FONT>

Note
When using this element, care should be taken to try to use font types that will be installed on the user's computer if you want the text to appear as desired. Changing the font is Internet Explorer specific and also can be set within a style sheet.

<HR>

A horizontal rule (<HR>) element is a divider between sections of text, such as a full-width horizontal rule or a similar graphic.

<HR>
<ADDRESS>April 12, 1996, Swansea</ADDRESS>
</BODY>

The <HR> element specifies that a horizontal rule of some sort (the default is a shaded, engraved line) be drawn across the page. It is possible to control the format of the horizontal rule.

<HR ALIGN=left|right|center>

Because horizontal rules do not have to be the width of the page, it is necessary to allow the alignment of the rule to be specified. Using these values, rules can be set to display centered, left, or right aligned.

<HR COLOR=name|#rrggbb>

Internet Explorer enables you to specify the hard rule color. Accepted values are any of the Internet Explorer supported color names or any acceptable rrggbb hexadecimal triplet.

<HR NOSHADE>

For those times when a solid bar is required, the NOSHADE attribute lets you specify that the horizontal rule should not be shaded at all.

<HR SIZE=number>

The SIZE attribute lets you specify the thickness of the horizontal rule. The number value specifies how thick the rule will be in pixels.

<HR WIDTH=number|percent>

The default horizontal rule is always as wide as the page. With the WIDTH attribute, you can specify an exact width in pixels or a relative width measured in percent of the browser display window.

<Hx>...</Hx>

HTML defines six levels of heading. A heading element implies all the font changes, paragraph breaks before and after, and white space necessary to render the heading.

The highest level of headings is <H1>, followed by <H2>...<H6>.

An example follows:

<H1>This is a first level heading heading</H1>
Here is some normal paragraph text
<H2>This is a second level heading</H2>
Here is some more normal paragraph text.

The rendering of headings is determined by the browser, but typical renderings (as defined in the HTML 2.0 specification) follow:

<H1>...</H1> Bold, very large font, centered. One or two blank lines above and below.
<H2>...</H2> Bold, large font, flush left. One or two blank lines above and below.
<H3>...</H3> Italic, large font, slightly indented from the left margin. One or two blank lines above and below.
<H4>...</H4> Bold, normal font, indented more than H3. One blank line above and below.
<H5>...</H5> Italic, normal font, indented as H4. One blank line above.
<H6>...</H6> Bold, indented same as normal text, more than H5. One blank line above.

Note
These heading alignments can be overridden by using <CENTER> elements or by ALIGNing the heading.

Although heading levels can be skipped (for example, from H1 to H3), this practice is not recommended because skipping heading levels may produce unpredictable results when generating other representations from HTML. For example, much talked about automatic contents/index generation scripts could use heading settings to generate contents trees where <H2> would be considered to label the start of a section that is a subsection of a section denoted by an <H1> element, and so on.

Included in the HTML 3.2 specification is the capability to align headings.

ALIGN=left|center|right can be added to the <H1> through to <H6> elements. For example,

<H1 ALIGN=center>This is a centered heading</H1>

aligns a heading of style 1 in the center of the page.

Note
This element currently is supported only by Mosaic and Netscape. The Internet Explorer supports only the center value, centering the heading.

<LISTING>...</LISTING>

The <LISTING> element can be used to present blocks of text in fixed-width font, so it is suitable for text that has been formatted on-screen. As such, it is similar to the <PRE> and <XMP> element but has a different syntax.

Typically, it renders as fixed-width font with white space separating it from other text. It should be rendered so that 132 characters fit on the line.

Note
Only Netscape actually complies with this.

The code

Some might say<LISTING>that two heads</LISTING>are better than one

renders as

Some might say

that two heads

are better than one.

Note
The Internet Explorer and Netscape translate any special characters included within <LISTING> elements. If characters such as &lt;, &gt;, and so on are used, they are translated to < and >. Mosaic treats the text contained within the elements literally.

<MARQUEE>...</MARQUEE>

Note
This element currently is supported only by Microsoft Internet Explorer.

The <MARQUEE> element allows you to create a region of text that can be made to scroll across the screen (much like the Windows Marquee screen saver):

<MARQUEE>This text will scroll from left to right slowly</MARQUEE>

ALIGN

This attribute can be set to TOP, MIDDLE, or BOTTOM and specifies that the text around the marquee should align with the top, middle, or bottom of the marquee.

<MARQUEE ALIGN=TOP>Hello in browser land.</MARQUEE>Welcome to this page

The text Welcome to this page is aligned with the top of the marquee (which scrolls the text Hello in browser land across the screen).

Note
Until the marquee width is limited by setting the WIDTH attribute, the marquee occupies the whole width of the browser window, and any following text is rendered below the marquee.

BEHAVIOR

This can be set to SCROLL, SLIDE, or ALTERNATE. It specifies how the text displayed in the marquee should behave. SCROLL (the default) makes the marquee test start completely off one side of the browser window, scroll all the way across and completely off the opposite side, and then start again. SLIDE causes the text to scroll in from one side of the browser window and then stick at the end of its scroll cycle. ALTERNATE means bounce back and forth within the window.

<MARQUEE BEHAVIOR=ALTERNATE>This marquee will "bounce" across the screen</
MARQUEE>

BGCOLOR

This specifies a background color for the marquee, as an rrggbb hexadecimal triplet or as one of the reserved color names. (See <BODY BGCOLOR> for more information.)

DIRECTION

This specifies in which direction the <MARQUEE> text should scroll. The default is LEFT, which means that the text will scroll to the left from the right-hand side of the marquee. This attribute also can be set to RIGHT, which causes the marquee text to scroll from the left to the right.

HEIGHT

This specifies the height of the marquee, in pixels (HEIGHT=n) or as a percentage of the screen height (HEIGHT=n%).

HSPACE

This attribute is the same as that for <IMG> (images). It specifies the number of pixels of free space at the left- and right-hand sides of the marquee so that the text that flows around it doesn't push up against the sides.

LOOP

LOOP=n specifies how many times a marquee loops when activated. If n=-1 or LOOP=INFINITE is specified, the marquee action loops indefinitely.

Note
If text is enclosed in a <MARQUEE>...</MARQUEE> element set, it defaults to an infinite loop action.

SCROLLAMOUNT

Specifies the number of pixels between each successive draw of the marquee text-the amount for the text to move between each draw.

SCROLLDELAY

SCROLLDELAY specifies the number of milliseconds between each successive draw of the marquee text; it controls the speed at which the text draw takes place.

The following marquee would be extremely fast:

<MARQUEE SCROLLDELAY=1 SCROLLAMOUNT=75>Hello.</MARQUEE>

VSPACE

This attribute is the same as that for <IMG> (images). It specifies the number of pixels of free space at the top and bottom edges of the marquee so that the text that flows around it doesn't push up against the sides.

Note
If you want to set the <FONT> to be displayed in the marquee, the <MARQUEE> definition should be enclosed inside the <MARQUEE>, as in this example:
<FONT FACE="Comic Sans MS"><MARQUEE>Hello!</MARQUEE></FONT>

WIDTH

This specifies the width of the marquee, in pixels (WIDTH=n) or as a percentage of the screen height (WIDTH=n%).

<NOBR>...</NOBR>

The <NOBR> (no break) element specifies that all the text between the start and end of the <NOBR> elements cannot have line breaks inserted. Although <NOBR> may be essential for those character sequences that you don't want to be broken, it should be used carefully; long text strings inside <NOBR> elements can look rather odd, especially if the user adjusts the page size by altering the window size.

Note
The <NOBR> element is supported only by Netscape and Internet Explorer.

<P>...</P>

The paragraph element indicates a paragraph of text. No specification has ever attempted to define exactly the indentation of paragraph blocks, and this may be a function of other elements, style sheets, and so on.

Typically, paragraphs should be surrounded by a vertical space of between one and one-and-a-half lines. With some browsers, the first line in a paragraph may be indented.

<H1>The Paragraph element</H1>
<P>The paragraph element is used to denote paragraph blocks.</P>
<P>This would be the second paragraph.</P>

Included in the HTML 3.2 specification is the capability to align paragraphs.

Basically, the ALIGN=left|center|right attribute and values have been added to the <P> element.

In the following example, all text within the paragraph will be aligned to the left side of the page layout. This setting is equal to the default <P> element:

<P ALIGN=LEFT> ... </P>

In this example, all text within the paragraph is aligned to the center of the page. (See also <CENTER>...</CENTER>.)

<P ALIGN=CENTER> ... </P>

In this example, all text is aligned to the right side of the page.

<P ALIGN=RIGHT> ... </P>

Note
Internet Explorer supports only the use of the left and center values, whereas Mosaic and Netscape support the use of all three values.

<PLAINTEXT>

The <PLAINTEXT> element can be used to represent formatted text. As such, it is similar to the <XMP> and <LISTING> element. However, the <PLAINTEXT> element should be an open element, with no closing element. Only Netscape supports this element according to any HTML specification. Internet Explorer and Mosaic will allow the use of a </PLAINTEXT> closing element. Netscape treats the closing element literally and displays it.

Typically, it renders as fixed-width font with white space separating it from other text.

I live<PLAINTEXT>in the rainiest part of the world.

renders as

I live
in the rainiest part of the world.

Anything following the opening <PLAINTEXT> element should be treated as text. Only Netscape behaves like this. Internet Explorer and Mosaic allow the use of a closing </PLAINTEXT> element, allowing discrete blocks of <PLAINTEXT> formatted text to be displayed.

<PRE>...</PRE>

The preformatted text element presents blocks of text in fixed-width font and is suitable for text that has been formatted on-screen or in a monospaced font.

The <PRE> element may be used with the optional WIDTH attribute, which is an HTML Level 1 feature. The WIDTH attribute specifies the maximum number of characters for a line and allows the browser to determine which of its available fonts to use and how to indent the text (if at all). If the WIDTH attribute is not present, a width of 80 characters is assumed. Where the WIDTH attribute is supported, widths of 40, 80, and 132 characters should be presented optimally, with other widths being rounded up.

Within preformatted text, any line breaks within the text are rendered as a move to the beginning of the next line. The <P> element should not be used, but if it is found, it should be rendered as a move to the beginning of the next line. It is possible to use anchor elements, and character highlighting elements are allowed. Elements that define paragraph formatting (headings, address, and so on) must not be used. The horizontal tab character (encoded in US-ASCII and ISO-8859-1 as decimal 9) represents a special formatting case. It should be interpreted as the smallest positive nonzero number of spaces that will leave the number of characters so far on the line as a multiple of 8. (However, despite being allowed, its use is not recommended.)

Note
It is at the discretion of individual browsers how to render preformatted text. Where "beginning of a new line" is implied, the browser can render that new line indented if it sees fit.
For example,
<PRE WIDTH="80">
This is an example of preformatted text.
</PRE>
Within a preformatted text element, the constraint that the rendering must be on a fixed horizontal character pitch may limit or prevent the capability of the browser to render highlighting elements specially.

<WBR>

The <WBR> element (word break) is for the very rare case when a <NOBR> section requires an exact break. Also, it can be used any time the browser can be helped by telling it where a word is allowed to be broken. The <WBR> element does not force a line break (<BR> does that); it simply lets the browser know where a line break is allowed to be inserted if needed.

Note
<WBR> is supported only by Netscape and the Internet Explorer.

<XMP>...</XMP>

The <XMP> element can be used to present blocks of text in fixed-width font and is suitable for text that has been formatted on-screen. As such, it is similar to the <PRE> and <LISTING> elements but has a different syntax.

Typically, it renders as fixed-width font with white space separating it from other text. It should be rendered so that 80 characters fit on the line. For example,

The <XMP>Netscape Navigator</XMP>supports colored tables.

renders as

The
Netscape Navigator
doesn't support colored tables.

Note
The Internet Explorer translates any special characters included within <XMP> elements. If characters such as &lt;, &gt;, and so on are used, they are translated to < and >. Netscape and Mosaic treat the text contained within the elements literally.

Character Data

Within an HTML document, any characters between the HTML elements represent text. An HTML document (including elements and text) is encoded by means of a special character set described by the charset parameter as specified in the text/html MIME type. Essentially, this is restricted to a character set known as US-ASCII (or ISO-8859-1), which encodes the set of characters known asLatin Alphabet No 1 (commonly abbreviated to Latin-1). This covers the characters from most Western European languages. It also covers 25 control characters, a soft hyphen indicator, 93 graphical characters, and 8 unassigned characters.

It should be noted that non-breaking space and soft hyphen indicator characters are not recognized and interpreted by all browsers; because of this, their use is discouraged.

There are 58 character positions occupied by control characters. See "Control Characters" for details on the interpretation of control characters.

Because certain special characters are subject to interpretation and special processing, information providers and browser implementers should follow the guidelines in the "Special Characters" section.

In addition, HTML provides character-entity references and numerical character references to facilitate the entry and interpretation of characters by name and by numerical position.

Because certain characters are interpreted as markup, they must be represented by entity references as described in "Character and/or Numerical References."

Character Entity References

Many of the Latin-1 set of printing characters may be represented within the text of an HTML document by a character entity.

It may be beneficial to use character entity references instead of directly typing the required characters as described in the numerical entity references; this enables you to compensate for keyboards that don't contain the required characters (such as characters common in many European languages) and for characters that may be recognized as SGML coding.

A character entity is represented in an HTML document as an SGML entity whose name is defined in the HTML DTD. The HTML DTD includes a character entity for each of the SGML markup characters and for each of the printing characters in the upper half of Latin-1, so you can reference them by name if it is inconvenient to enter them directly:

the ampersand (&amp;), double quotation marks (&quot;), lesser (&lt;) and greater (&gt;) characters

Kurt G&ouml;del was a famous logician and mathematician.

Note
To ensure that a string of characters is not interpreted as markup, represent all occurrences of <, >, and & by character or entity references.

Table B.2 contains the possible numeric and character entities for the ISO-Latin-1 (ISO8859-1) character set. Where possible, the character is shown.

Note
Not all browsers can display all characters, and some browsers may even display characters different from those that appear in the table. Newer browsers seem to have a better track record for handling character entities, but be sure to test your HTML files extensively with multiple browsers if you intend to use these entities.

Table B.2. ISO-Latin-1 character set.

Character
Numeric Entity
Hex Value
Character Entity (if any)
Description
 
&#00;-&#08;
00-08
 
Unused
 
&#09;
09
 
Horizontal tab
 
&#10;
0A
 
Line feed
 
&#11;-&#31;
0B-1F
 
Unused
 
&#32;
20
 
Space
!
&#33;
21
 
Exclamation mark
"
&#34;
22
&quot;
Quotation mark
#
&#35;
23
 
Number sign
$
&#36;
24
 
Dollar sign
%
&#37;
25
 
Percent sign
&
&#38;
26
&amp;
Ampersand
'
&#39;
27
 
Apostrophe
(
&#40;
28
 
Left parenthesis
)
&#41;
29
 
Right parenthesis
*
&#42;
2A
 
Asterisk
+
&#43;
2B
 
Plus sign
,
&#44;
2C
 
Comma
-
&#45;
2D
 
Hyphen
.
&#46;
2E
 
Period (fullstop)
/
&#47;
2F
 
Solidus (slash)
0-9
&#48;-&#57;
30-39
 
Digits 0-9
:
&#58;
3A
 
Colon
;
&#59;
3B
 
Semicolon
<
&#60;
3C
&lt;
Less than
=
&#61;
3D
 
Equal sign
>
&#62;
3E
&gt;
Greater than
?
&#63;
3F
 
Question mark
@
&#64;
40
 
Commercial at
A-Z
&#65;-&#90;
41-5A
 
Letters A-Z
[
&#91;
5B
 
Left square bracket
\
&#92;
5C
 
Reverse solidus (backslash)
]
&#93;
5D
 
Right square bracket
^
&#94;
5E
 
Caret
-
&#95;
5F
 
Horizontal bar
`
&#96;
60
 
Grave accent
a-z
&#97;-&#122;
61-7A
 
Letters a-z
{
&#123;
7B
 
Left curly brace
|
&#124;
7C
 
Vertical bar
}
&#125;
7D
 
Right curly brace
~
&#126;
7E
 
Tilde
 
&#127;-&#160;
7F-A0
 
Unused
¡
&#161;
A1
Inverted Exclamation point
¢
&#162;
A2
 
Cent sign
£
&#163;
A3
 
Pound sterling
¤
&#164;
A4
 
General currency sign
¥
&#165;
A5
 
Yen sign
|
&#166;
A6
 
Broken vertical bar
§
&#167;
A7
 
Section sign
¨ 
&#168;
A8
 
Umlaut (dieresis)
"
&#169;
A9
&copy; (NHTML)
Copyright
ª
&#170;
AA
 
Feminine ordinal
&#171;
AB
 
Left angle quotation, guillemot left
¬
&#172;
AC
 
Not sign
-
&#173;
AD
 
Soft hyphen
&#174;
AE
&reg; (HHTM)
Registered trademark
¯
&#175;
AF
 
Macron accent
°
&#176;
B0
 
Degree sign
±
&#177;
B1
 
Plus or minus
2
&#178;
B2
 
Superscript two
3
&#179;
B3
 
Superscript three
´ 
&#180;
B4
 
Acute accent
µ
&#181;
B5
 
Micro sign
T
&#182;
B6
 
Paragraph sign
¹
&#183;
B7
 
Middle dot
¸
&#184;
B8
 
Cedilla
1
&#185;
B9
 
Superscript one
º
&#186;
BA
 
Masculine ordinal
&#187;
BB
 
Right angle quota- tion, guillemot right
1/4
&#188;
BC
 
Fraction one-fourth
1/2
&#189;
BD
 
Fraction one-half
3/4
&#190;
BE
Fraction three- fourths
¿
&#191;
BF
 
Inverted question mark
À
&#192;
C0
&Agrave;
Capital A, grave accent
Á
&#193;
C1
&Aacute;
Capital A, acute accent
Â
&#194;
C2
&Acirc;
Capital A, circumflex accent
Ã
&#195;
C3
&Atilde;
Capital A, tilde
Ä
&#196;
C4
&Auml;
Capital A, dieresis or umlaut mark
Å
&#197;
C5
&Aring;
Capital A, ring
Æ
&#198;
C6
&AElig;
Capital AE dipthong (ligature)
Ç
&#199;
C7
&Ccedil;
Capital C, cedilla
È
&#200;
C8
&Egrave;
Capital E, grave accent
É
&#201;
C9
&Eacute;
Capital E, acute accent
Ê
&#202;
CA
&Ecirc;
Capital E, circumflex accent
Ë
&#203;
CB
&Euml;
Capital E, dieresis or umlaut mark
Ì
&#204;
CC
&Igrave;
Capital I, grave accent
Í
&#205;
CD
&Iacute;
Capital I, acute accent
Î
&#206;
CE
&Icirc;
Capital I, circumflex accent
Ï
&#207;
CF
&Iuml;
Capital I, dieresis or umlaut mark
q
&#208;
D0
&ETH;
Capital Eth, Icelandic
Ñ
&#209;
D1
&Ntilde;
Capital N, tilde
Ò
&#210;
D2
&Ograve;
Capital O, grave accent
Ó
&#211;
D3
&Oacute;
Capital O, acute accent
Ô
&#212;
D4
&Ocirc;
Capital O, circumflex accent
Õ
&#213;
D5
&Otilde;
Capital O, tilde
Ö
&#214;
D6
&Ouml;
Capital O, dieresis, or umlaut mark
r
&#215;
D7
 
Multiply sign
o
&#216;
D8
&Oslash;
Capital O, slash
Ù
&#217;
D9
&Ugrave;
Capital U, grave accent
Ú
&#218;
DA
&Uacute;
Capital U, acute accent
Û
&#219;
DB
&Ucirc;
Capital U, circumflex accent
Ü
&#220;
DC
&Uuml;
Capital U, dieresis or umlaut mark
s
&#221;
DD
&Yacute;
Capital Y, acute accent
 
&#222;
DE
&THORN;
Capital THORN, Icelandic
 
&#223;
DF
&szlig;
Small sharp s, German (sz ligature)
à
&#224;
E0
&agrave;
Small a, grave accent
á
&#225;
E1
&aacute;
Small a, acute accent
â
&#226;
E2
&acirc;
Small a, circumflex accent
ã
&#227;
E3
&atilde;
Small a, tilde
ä
&#228;
E4
&aauml;
Small a, dieresis or umlaut mark
å
&#229;
E5
&aring;
Small a, ring
æ
&#230;
E6
&aelig;
Small ae dipthong (ligature)
ç
&#231;
E7
&ccedil;
Small c, cedilla
è
&#232;
E8
&egrave;
Small e, grave accent
é
&#233;
E9
&eacute;
Small e, acute accent
ê
&#234;
EA
&ecirc;
Small e, circumflex accent
ë
&#235;
EB
&euml;
Small e, dieresis or umlaut mark
ì
&#236;
EC
&igrave;
Small i, grave accent
í
&#237;
ED
&iacute;
Small i, acute accent
î
&#238;
EE
&icirc;
Small i, circumflex accent
ï
&#239;
EF
&iuml;
Small i, dieresis or umlaut mark
u
&#240;
F0
&eth;
Small eth, Icelandic
ñ
&#241;
F1
&ntilde;
Small n, tilde
ò
&#242;
F2
&ograve;
Small o, grave accent
ó
&#243;
F3
&oacute;
Small o, acute accent
ô
&#244;
F4
&ocirc;
Small o, circumflex accent
õ
&#245;
F5
&otilde;
Small o, tilde
ö
&#246;
F6
&ouml;
Small o, dieresis or umlaut mark
ˆ
&#247;
F7
 
Division sign
h
&#248;
F8
&oslash;
Small o, slash
ù
&#249;
F9
&ugrave;
Small u, grave accent
ú
&#250;
FA
&uacute;
Small u, acute accent
û
&#251;
FB
&ucirc;
Small u, circumflex accent
ü
&#252;
FC
&uuml;
Small u, dieresis or umlaut mark
v
&#253;
FD
&yacute;
Small y, acute accent
 
&#254;
FE
&thorn;
Small thorn, Icelandic
ÿ
&#255;
FF
&yuml;
Small y, dieresis or umlaut mark

Control Characters

Control characters are non-printable characters that typically are used for communication and device control, as format effectors, and as information separators.

In SGML applications, the use of control characters is limited in order to maximize the chance of successful interchange over heterogenous networks and operating systems. In HTML, only three control characters are used: horizontal tab (HT, encoded as 9 decimal in US-ASCII and ISO-8859-1), carriage return, and line feed.

A horizontal tab is interpreted as a word space in all contexts except preformatted text. Within preformatted text, the tab should be interpreted to shift the horizontal column position to the next position that is a multiple of 8 on the same line; that is, col := ((col+8) div8) * 8 (where div is integer division).

Carriage returns and line feeds conventionally are used to represent the end of a line. For Internet Media Types defined as text/*, the sequence CR/LF is used to represent the end of a line. In practice, text/html documents frequently are represented and transmitted using an end-of-line convention that depends on the conventions of the source of the document; frequently, that representation consists of CR only, LF only, or a CR/LF combination. In HTML, the end of line in any of its variations is interpreted as a word space in all contexts except preformatted text. Within preformatted text, HTML interpreting agents should expect to treat any of the three common representations of end of line as starting a new line.

Numeric Character References

In addition to any mechanism by which characters may be represented by the encoding of the HTML document, it is possible to explicitly reference the printing characters of the Latin-1 character encoding using a numeric character reference.

There are two principal cases for using a numeric character reference. First, some keyboards may not provide the necessary characters (such as those that use accents, cedillas, dieresis marks, and so on) commonly used in European languages. Second, some characters would be interpreted as SGML coding (for example, the ampersand (&), quotation marks (" "), less than sign (<), and greater than sign (>) characters) and therefore should be referred to by numerical references.

Numeric character references are represented in an HTML document as SGML entities in which the name is a number sign (#) followed by a numeral from 32-126 and 161-255. The HTML DTD includes a numeric character for each of the printing characters of the
Latin-1 encoding, so you can reference them by number if it is inconvenient to enter them directly: the ampersand (&#38;), quotation marks (&#34;), lesser (&#60;) and greater (&#62;) char-acters.

The following entity names are used in HTML, always prefixed by ampersand (&) and followed by a semicolon (see Table B.1).

Special Characters

Certain characters have special meanings in HTML documents. There are two printing characters that may be interpreted by an HTML application to have an effect of the format of the text.

Space

This is interpreted as a single word space (the section of a paragraph of text where the text can be broken if necessary-for example, where lines can be broken for text wrapping) except when it is used within <PRE>...</PRE> elements. Within preformatted text elements, a space is interpreted as a nonbreaking space.

Hyphen

This is interpreted as a hyphen glyph in all contexts.

The following entity names are used in HTML, always prefixed by ampersand (&) and followed by a semicolon (;). They represent particular graphics characters that have special meanings in places in the markup or may not be part of the character set available to the writer.

Glyph
Name
Syntax
Description
<
lt
&lt;
Less than sign
>
gt
&gt;
Greater than sign
&
amp
&amp;
Ampersand
"
quot
&quot;
Quotation mark

Document Sound

Note
Two different elements now exist for employing inline sound directly in an HTML document. The first is BGSOUND; this element currently is supported only by Microsoft Internet Explorer. The other is SOUND, which currently is supported only by NCSA Mosaic. Mosaic also supports a limited version of Microsoft's BGSOUND element. Netscape can support inline sound via the plugin mechanism. See <EMBED> for more details.

The BGSOUND element allows you to create pages that play sound clips or background soundtracks while the page is being viewed. Sounds can be samples (.WAV or .AU) or MIDI (.MID) format.

<BGSOUND>

The HTML used to insert a background sound into a page is

<BGSOUND SRC="start.wav">

The BGSOUND element accepts the following attributes.

SRC

Specifies the address of a sound to be played.

LOOP=n

Specifies how many times a sound loops when activated. If n=-1 or LOOP=INFINITE is specified, the sound loops indefinitely.

Mosaic supports use of the SOUND element for playing inline sound. This element allows the playing of *.WAV files in pages.

Note
The SOUND element is supported only by Mosaic.

The syntax is

<SOUND SRC="filename.wav">

The <SOUND> element supports the following attributes:

LOOP=infinite and DELAY=sec

LOOP=infinite plays the sound sample continuously while the page is being viewed.

DELAY=sec delays playing of the sound file for sec seconds after the page and sound file finish loading.

Note
Although Mosaic supports the use of the BGSOUND element (for .WAV file), it does not play inline *.MID MIDI files without launching an external application as defined in the Helper Application setup.

Dynamic Documents

Recent advances in browser technology have been pushing the idea of active content. To this end, you should be aware of a few HTML methods:

Server push  This mechanism generally has been used for providing animation within Web pages, whereby the Web server serves the page that the browser has requested and keeps the client (browser) to server connection open and repeatedly sends chunks of data as long as the connection is kept open. To be able to take advantage of such a mechanism requires an in-depth knowledge of MIME types, the HTTP transport protocol, and CGI scripting or programming. It therefore is recommended only for programmers.

Client pull  As seen in the discussion of the <META> element, this method provides a useful automatic redirection mechanism for serving Web pages. The server serves the browser the requested page (which contains metainformation) which makes the browser believe that it has received certain HTTP response headers, which typically would be used to make the browser retrieve a different document. For more details, see the <META> element.

Server Push

Server push allows for dynamic document updating via a server-to-client connection that is kept open. This method (as opposed to client pull) is totally controlled by the server, but the perpetual open connection occupies valuable server resources. Its main advantage over client pull is that you can use server push to replace a single inline image in a page repeatedly. All that is needed is that the SRC attribute of the image to be updated points to a URL that continually pushes image data through the open HTTP connection.

The exact server push mechanism is technically complex and is outside the scope of this reference. This section presents a brief outline of the method. Those interested in utilizing server push in CGI scripts or Web server-based executable applications should visit the Netscape Web site (http://home.netscape.com/) for more information. It should be noted that only Netscape supports the use of server push.

When a Web server receives a request for an HTML document to be retrieved, it typically sends a single set of data (the actual HTML document). MIME possesses a facility whereby many pieces of data can be sent encapsulated in a single message by using the MIME type multipart/mixed where the message is split into separate data sections, each provided with their own MIME type (given in the content header) so that the browser can distinguish between the different data in the different sections of the message. Server push uses a variation on this MIME type, called multipart/x-mixed-replace (the x- represents the fact that the MIME type is experimental and has not achieved standardized use). It is by virtue of the replace section that certain sections of the message can be replaced. Essentially, the server does not push down the entire message at once. It sends down sections (data chunks) of the message when it sees fit (or as controlled by the server push script or application). When the browser sees a separator (sent down in the multipart/x-mixed-replace message), it just sits and waits for the next data object to be sent, which it then uses to replace the data previously sent by the server.

Forms

Perhaps the biggest advance the HTML 2.0 specification made over its predecessors was the inclusion of elements that allowed for users to input information. These elements are the <FORM> elements. They provide for the inclusion of objects like text boxes, choice lists, and so on, and have proved invaluable for recent HTML applications-particularly, search engines, database query entry, and so on.

It should be noted that although these HTML elements can be used to easily define the presentation of the form to the user, the real value behind any form is in what it does with the information that is entered. For a form to do anything more than send a straight text dump of the form data (including control characters) to an e-mail address, the form data will need to be passed to some kind of CGI script or server-based executable for processing.

The following elements are used to create forms:

<FORM>...</FORM> A form within a document
<INPUT ...>...</INPUT> One input field
<OPTION> One option within a Select element
<SELECT>...<SELECT> A selection from a finite set of options
<TEXTAREA ...>...</TEXTAREA> A multi-line input field

Each variable field is defined by an INPUT, TEXTAREA, or OPTION element and must have a NAME attribute to identify its value in the data returned when the form is submitted.

A very simple form for eliciting user response follows, and its output is shown in Figure B.1.

Figure B.1: The Windows 95 version of Atlas Preview 1 (3.0 beta 2) showing Netscape's support for use of the <TEXTAREA WRAP="VIRTUAL"> element.

<H1 ALIGN="center">Comment Form</H1>
<FORM METHOD="POST" ACTION="http://www.htmlib.com/formscript.cgi">
<CENTER>
Your name: <INPUT NAME="name" size="20">
Your e-mail address: <INPUT NAME="email" size="20">
<P>I think the HTML Reference is:
  <SELECT NAME="Choice">
    <OPTION>Outstanding
    <OPTION>Very good
    <OPTION>Good
    <OPTION>Average
    <OPTION>Below Average
    <OPTION>Awful
    <OPTION SELECTED>My response would be "indecent" under the CDA Act.
  </SELECT>
<P>If you have any further comments, please enter them here:<BR>
  <TEXTAREA NAME="Comments" ROWS="10" COLS="40" WRAP="Virtual">
  </TEXTAREA>
<P><INPUT TYPE=SUBMIT> <INPUT TYPE=RESET>
</CENTER>
</FORM>

Different platforms will have different native systems for navigating within the input fields of a form. (For example,Windows users can use the Tab key to move from one field to the next through the order that the fields appear within the form.) Different browsers also may display different text on any buttons included in the form. For example, Netscape defaults to displaying Submit Query for a button specified by <INPUT TYPE=SUBMIT>, whereas the Internet Explorer and Mosaic display just Submit on such a button.

HTTP File Upload

It is possible to write forms that ask for files as input, rather than data input by input boxes and other simple elements such as check boxes and radio buttons.

An example of such a form follows:

<FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST>
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>

Note
This method of file upload is Netscape specific and is essentially adoption of another IETF Internet Draft by the Netscape authors. The Internet Draft in question, "Form based file upload in HTML," details adding the FILE option to the TYPE attribute of the INPUT element, allowing an ACCEPT attribute for the INPUT element (which would be a list of MIME types-essentially detailing what files are allowed to be uploaded as the contents of the form) and allowing the ENCTYPE of a form to be multipart/form-data. This MIME type essentially wraps the form data (including that presented in any other input fields) as a data stream, with discrete boundaries between the information sections. For a more detailed description, readers should check the HTTP file upload specification.

The display method is largely at the discretion of the browsers that support this method. Netscape (Windows versions) displays a Browse button beside the input box, which brings up the standard Open/Save dialog box, allowing the choice of any local file for upload.

<FORM>...</FORM>

The <FORM> element is used to delimit a data input form. There can be several forms in a single document, but the <FORM> element cannot be nested. (A form can't contain another form.)

<FORM ACTION="_URL_" METHOD="GET|POST" ENCTYPE="MIME type">

The ACTION attribute is a URL specifying the location to which the contents of the form data fields are submitted to elicit a response. As mentioned before, this could be simply a direction to an e-mail address, but generally it is used to point toward some kind of server-based CGI script/application that handles the forwarding of form data. If the ACTION attribute is missing, the URL of the document itself is assumed. The way data is submitted varies with the access protocol of the URL to which the form data is sent and with the values of the METHOD and ENCTYPE attributes.

Generally, the METHOD attribute specifies a method of accessing the URL specified in the ACTION atbute. Generally, the method is GET or POST. The GET method is ideal for form submission where the use of the form data does not require external processing. With database searches, for example, there is no lasting effect caused by the query of the form (the query runs its search through the database and reports the results). However, when the form is used to provide information that updates a database, the POST method should be used, with the ACTION attribute pointing to a CGI script that executes the form data processing.

The ENCTYPE specifies the media type used to encode the form data. The default ENCTYPE is the MIME type application/x-www-form-urlencoded.

<INPUT>

The <INPUT> element represents a field whose contents may be edited or activated by the user.

Attributes of the <INPUT> element follow.

ALIGN

To be used with the TYPE=IMAGE setting, this attribute specifies the alignment of the image. It takes the same values as the ALIGN in the <IMG> element.

CHECKED

To be used with a TYPE=CHECKBOX or TYPE=RADIO setting, this indicates that the check box or radio button is selected.

MAXLENGTH

To be used with TYPE=TEXT setting, this indicates the maximum number of characters that can be entered into a text field. This can be greater than specified by the SIZE attribute, in which case the field scrolls appropriately. The default number of characters is unlimited.

NAME

Represents the name that will be used for the data when transferring the form's contents. The NAME attribute is required for most input types and normally is used to provide a unique identifier for a field or a logically related group of fields.

SIZE

Specifies the size or precision of the field according to its type. For example, to specify a field with a visible width of 24 characters, use this code:

INPUT TYPE=text SIZE="24"

SRC

To be used with the TYPE=IMAGE, represents a URL specifying the desired image.

TYPE

Defines the type of data the field accepts. Defaults to free text. Several types of fields can be defined with the type attribute:

Note
In a future version of the HTML specification, the IMAGE functionality may be folded into an enhanced SUBMIT field.

VALUE

When used with TYPE= ... attributes, this attribute sets the initial displayed value of the field if it displays a textual or numerical value. If the TYPE= ... attribute is one that only allows Boolean values (chosen or not chosen), this specifies the value to be returned when the field is selected.

<OPTION>

The <OPTION> element can occur only within a <SELECT> element. It represents one choice and can take these attributes:

  1. SELECTED  Indicates that this option initially is selected.
  2. VALUE  When present, indicates the value to be returned if this option is chosen. The returned value defaults to the contents of the <OPTION> element. The contents of the <OPTION> element are presented to the user to represent the option. It is used as a returned value if the VALUE attribute is not present.

<SELECT ...>...</SELECT>

The <SELECT> element allows the user to chose one of a set of alternatives described by textual labels. Every alternative is represented by the <OPTION> element.

Attributes used with <SELECT> follow:

  1. MULTIPLE  Needed when users are allowed to make several selections-for example, <SELECT MULTIPLE>.
  2. NAME  Specifies the name that will submitted as a name/value pair.
  3. SIZE  Specifies the number of visible items. If this is greater than one, then the resulting form control will be a list.

The <SELECT> element typically is rendered as a pull-down or pop-up list, as in this example:

<SELECT NAME="Choice">
  <OPTION>Outstanding
  <OPTION>Very good
  <OPTION>Good
  <OPTION>Average
  <OPTION>Below Average
  <OPTION>Awful
  <OPTION SELECTED>My response would be "indecent" under the CDA Act.
</SELECT>

<TEXTAREA>...</TEXTAREA>

The <TEXTAREA> element lets users enter more than one line of text.

Any text included up to the end element (</TEXTAREA>) is used to initialize the field's value. This end element always is required even if the field initially is blank. When submitting a form, lines in a TEXTAREA should be terminated using CR/LF.

In a typical rendering, the ROWS and COLS attributes determine the visible dimension of the field in characters. The field is rendered in a fixed-width font. Browsers should allow text to extend beyond these limits by scrolling as needed.

Recent versions of Netscape (from version 2.0) have introduced the WRAP attribute in the <TEXTAREA> element: Now it is possible to specify how to handle word-wrapping display in text-input areas in forms.

<TEXTAREA WRAP=OFF> The default setting. Wrapping doesn't happen. Lines are sent exactly as typed.
<TEXTAREA WRAP=VIRTUAL> The display word wraps, but long lines are sent as one line without new lines.
<TEXTAREA WRAP=PHYSICAL> The display word wraps, and the text is transmitted at all wrap points.

Note
Word wrapping in a TEXTAREA text box is supported by Netscape only.

Advanced Page Formatting

Note
The use of frames currently is supported only by recent versions of Netscape (from version 2.0) and Internet Explorer (3.0 and above).

Frames allow the browser display window to be subdivided into separate sections, each of which can be updated, or have new documents loaded into it separately from the remaining frame sections. As such, a frame-based layout can be especially useful for HTML applications where some information is required across a whole range of pages (such as a table of contents or title graphics, for example).

Frames are generated by three elements: <FRAMESET>, <FRAME>, and <NOFRAMES>.

Frame Document

A frame document has a basic structure very much like a normal HTML document, except the BODY container is replaced by a FRAMESET container that describes the sub-HTML documents or frames that will make up the page:

<HTML>
<HEAD>
</HEAD>
<FRAMESET>

</FRAMESET>
</HTML>

No HTML that normally would be included within the <BODY> section of an HTML document should be included within the <FRAMESET> ... </FRAMESET> elements.

Frame Syntax

<FRAMESET>

This is the main container for a frame. It has two attributes: ROWS and COLS. The <FRAMESET> element has a matching end element, and within the <FRAMESET> you can have other nested <FRAMESET>, <FRAME>, or <NOFRAMES> elements.

ROWS="row_height_value_list"

This takes a list of values, separated by commas. They can represent absolute pixel, percentage, or relative scaling values. The total set by the values given in the ROWS attribute should not exceed 100 percent (the total rows are extended across the whole available browser display window).
If any of the values are single numerical values, these are considered to be absolute pixel values. It is not recommended to fix a frame set by using a complete set of pixel values, because browsers use a variety of screen resolutions when viewing documents, so the layout may become distorted. Percentage values can be given for this attribute. If the total percentage values given exceed 100 percent, all values will be scaled down by the browser so that the total is 100 percent. The remaining value option is to use an asterisk (*) character. This tells the browser that the frame is a relative size frame and should be displayed accordingly. Numerical values can be used with the * character to scale the relative frame sections within the browser window.
To specify a three-framed vertical layout where the first section uses 20 percent of the display window, the second section uses 100 pixels, and the third section uses the remaining screen, use this code:
<FRAMESET ROWS="20%, 100, *>
To split the layout into two vertical frames (the first using a quarter of the display window and the second using three-quarters of the window), use this:
<FRAMESET ROWS="25%, 75%>
This is exactly the same as using <FRAMESET ROWS="*, 3*">.

COLS="column_width_list"

The COLS attribute takes as its value a comma-separated list of values that is of the exact same syntax as the list described for the ROWS attribute.
The <FRAMESET> element can be nested. In this way, frame sections can be set up where the display window can be split into horizontal or vertical sections, with any of these further sub-divided by nested <FRAMESET> elements.

<FRAME>

This element defines a single frame in a frameset. It has eight possible attributes: SRC, NAME, MARGINWIDTH, MARGINHEIGHT, SCROLLING, NORESIZE, FRAMEBORDER, and FRAMESPACING. The <FRAME> element is not a container, so it has no matching end tag.

SRC="url"

This attribute is used to specify the HTML document that will be used as the display in the particular frame section of the frameset.

NAME="frame_name"

The NAME attribute is used to assign a name to a frame so it can be targeted by links in other documents by using <A HREF="_URL_" TARGET="frame_name">. (These usually would be from other documents in the same frameset.) The NAME attribute is optional; by default, all windows are
unnamed.
Names must begin with an alphanumeric character. Several reserved names have been defined, which start with an underscore:

_blank Always load this link into a new, unnamed window.
_self Always load this link over the document that originated the link.
_parent Always load this link over the parent frame (becomes self if the frame has no parent or is the parent frame).
_top Always load this link at the top level (becomes self if the frame is the top frame).

Note
Although these are reserved names for the NAME attribute of the <FRAME> element, they should only be referred to using an anchor target. They should be used to target specific windows, allowing smoother transition between framed documents and between framed and non-framed documents (for example, when providing a link to documents on a foreign server that may not be framed documents). Although Internet Explorer supports the naming of frames for document navigation and hyperlinking, it doesn't support the use of the _blank reserved name for opening a document in a new browser window. Also, unlike Netscape, Internet Explorer will not open a new window for a link whose TARGET value has not been defined by a NAME attribute.

MARGINWIDTH="value"

This accepts an absolute pixel value and forces indentation from the left- and right-hand side of the frame pane according to the number of pixels. It cannot be set to a value less than 1 because this would cause the contents of the frame to be displayed right up against the left-hand margin. By default, the browser chooses its own MARGINWIDTH when trying to produce the best possible display.

MARGINHEIGHT="value"

This is similar to the MARGINWIDTH attribute, but it controls the top and bottom margins.

SCROLLING="yes|no|auto"

This attribute can be used to control the appearance of any scroll bars that may appear as a result of the frame contents being too much to display in the set pane. Using no may be dangerous, because the HTML author cannot know the resolution/display window size of the client browser, so information may not be displayable.

NORESIZE

By default, all frames specified in a framed document can be resized by the client. Setting this flag (it requires no value) prevents the frame from being resized.

FRAMEBORDER="yes|no"

This is an Internet Explorer specific attribute, which allows control of the frame border display. With this attribute set to no, the borders for the specific frame are not drawn.

FRAMESPACING="value"

This attribute is Internet Explorer-specific and allows the setting of extra space around frames to give the appearance of floating frames. The value should be the distance required around the frame in pixels.
For example,
<FRAME FRAMESPACING="40" ...>
presents the frame with an invisible border of 55 pixels.

<NOFRAMES>

This element is provided for HTML authors who want to create alternative content for browsers that cannot display frames. This is especially useful if the author is making the very first document of the site a framed document. It should be noted that this element is not actually recognized by non-frame-capable browsers. As with any HTML, if the browser does not recognize the element, it ignores it. Non-frame-capable browsers ignore all the <FRAMESET> and <FRAME> elements, but display whatever is enclosed in the <NOFRAMES> ... </NOFRAMES> elements, which can be any HTML at all, because that is what it recognizes. On the other hand, frame-capable browsers preferentially display what is set up by the frame elements, unless they provide any mechanism where the display of frames can be turned off (in which case they may display this alternative content).

The Main Frame Setup Document

The main document that sets up the sample frame follows:

<HTML>
<!--HTMLIB.HTM-->
<HEAD>
<TITLE>The HTML Reference Library</TITLE>
</HEAD>
<BASEFONT SIZE=3>

<FRAMESET ROWS="85,*,65">
<FRAME SCROLLING="no" NAME="title" NORESIZE SRC="title.htm">
<FRAMESET COLS="40%,60%">
<FRAME SCROLLING="yes" NAME="toc" SRC="toc.htm">
<FRAME SCROLLING="yes" NAME="main page" SRC="main.htm">
</FRAMESET>
<FRAME SCROLLING="no" NAME="HLP buttons" NORESIZE SRC="buttons.htm">

<NOFRAME>

</NOFRAME>
</FRAMESET>
</HTML>

A Line-by-Line Breakdown

<FRAMESET ROWS="85,*,65">

This line divides the page into three regions-the top region is 85 pixels in height, the bottom region is 65 pixels in height, and the middle region occupies the rest of the browser window.

<FRAME SCROLLING="no" NAME="title" NORESIZE SRC="title.htm">

This line sets the top region of the window (the region that is 85 pixels high) to be a non-
scrolling, non-resizable region. Its name is title (so any other link that specifies title with its TARGET attribute is displayed in this region).

<FRAMESET COLS="40%,60%">

This is a nested <FRAMESET> element that splits the middle region of the browser window into two sections horizontally. The left-hand section is 40 percent of the frame width, and the right-hand section is the remaining 60 percent of the frame width. (This also could have been achieved using <FRAMESET COLS="2*, 3*>.)

<FRAME SCROLLING="yes" NAME="toc" SRC="toc.htm">
<FRAME SCROLLING="yes" NAME="main page" SRC="main.htm">

These two lines (as the other <FRAME> line) set the attributes for the two middle sections of the page. It names the regions toc and main page, respectively, and links to the two pages to be displayed in the regions.

</FRAMESET>

This line closes the subframes that were opened in the middle section of the main framed regions.

<FRAME SCROLLING="no" NAME="buttons" NORESIZE SRC="buttons.htm">

This line defines the properties of the remaining main region of the window-the bottom region that is 65 pixels high. It defines it as a non-scrolling, non-resizable region (ideal for navigation tools).

The Title Document

Note
This document contains no mark up relevant to the use of the frames, but it is included for reasons of completeness.

This document is the title for the paged document. It resides in the top frame, which is a non-scrolling, non-resizeable frame. The title therefore will always be displayed in the same place. Note that for frame subdocuments, titles are not required. The title of the site will always be taken from the main frame page.

<HTML>
<!--TITLE.HTM-->
<BODY>
<BASEFONT SIZE=3>
<CENTER>
<H2 ALIGN=center>Hello and Welcome to the HTML Reference Library</H2>
<BR>
</CENTER>
</BODY>
</HTML>

The Contents Document

This is the Table of Contents page. It appears on the left scrolling frame region. This section has been used (in this example) for a stationary table of contents.

<HTML>
<!--TOC.HTM-->
<BODY>
<BASEFONT SIZE=2>
<CENTER>
Please Select a Volume<BR><BR>
<A HREF="lang.htm" TARGET="main page"><B>1) The HTML Language</B></A><BR>
<A HREF="qr.htm" TARGET="main page"><B>2) Quick Reference Guide</B></A><BR>
<A HREF="author.htm" TARGET="main page"><B>3) Contacting the Author</B></A><BR>
<A HREF="new.htm" TARGET="main page"><B>4) New in this version</B></A><BR>
</CENTER>
</BODY>
</HTML>

The use of the TARGET attribute in the anchor means that when each link is activated the document accessed will be displayed in the frame region named main page. Thus, any documents accessed from the table of contents appear in the framed region to the right of the table of contents.

The Main Text Document

Note
This document contains no mark up relevant to the use of the frames, but it is included for reasons of completeness.

This document is the document that appears in the right-hand framed region of the page the first time the page is accessed.

<HTML>
<!--MAIN.HTM-->
<BODY>
This reference, using the Internet Draft as an information base is an on-line
reference library of currently supported HTML elements - their syntax, and
use.<BR>
It assumes that the user has knowledge of the World Wide Web and the various
browsers available. Information on specific browsers, or the broader topic
of 'The World Wide Web' can be obtained by reading the World Wide Web FAQ.<BR>
</BODY>
</HTML>

The Navigation Buttons Document

Note
This document contains no mark up relevant to the use of the frames, but it is included for reasons of completeness.

This document resides at the bottom of the framed document. This region is a non-scrollable, non-resizable region. As such, it is ideal for a set of navigation buttons or other tools. For the purposes of this example, the buttons are just a graphics image.

<HTML>
<!--BUTTONS.HTM-->
<BODY>
<CENTER>
<IMG SRC="buttons.gif"><BR>
<FONT SIZE=1>&copy; Stephen Le Hunte 1995</FONT>
</CENTER>
</BODY>
</HTML>

The HTML Language Document

Note
This document contains no mark up relevant to the use of the frames, but it is included for reasons of completeness.

This document is accessed by choosing the first option from the table of contents. When accessed, it is displayed in the right-hand section of the middle regions.

<HTML>
<!--LANG.HTM-->
<BODY>
<CENTER><B>The HTML Language</B></CENTER>
<BR>
The vast range of HTML MarkUp currently supported by available browsers
(Web browsers, such as Netscape, Mosaic etc.) can be divided into the
following sections. Some elements featured here may not be supported by
all browsers. Where an element is known to be supported by specific
browsers, the element description will be labeled as such.<BR>
</BODY>
</HTML>

Inline Images

Recently, the <IMG> element has undergone the largest enhancements of all HTML 2.0 elements on the way to newer HTML standardization. This is due to the <IMG> element being probably the second most important markup element (behind the anchor element) because it handles all embedded graphical content in HTML documents.

The attributes commonly supported by the IMG element have had some recent additions to allow client-side imagemaps, embedded inline video clips, and embedded inline VRML worlds.

Formats
Netscape and Mosaic (and most other browsers) will only support use of GIF and JPG images within HTML documents. This can be extended with Netscape by embedding image formats within pages, providing the format is one that users have software to handle the installation on their system, or they have a plugin module specifically to handle that type of image (see <EMBED>). Also, Netscape natively supports progressive JPEG images.
Internet Explorer allows the use of GIF, JPEG, progressive JPEG images, PNG (portable network graphics) images, and BMP files, giving the author a wider variety of image formats from which to choose.
Netscape now fully supports the GIF89a format, which means that multi-image GIF files can be used to create animation sequences. Users are encouraged to seek out the GIF Construction Kit for more details and tools for the preparation of multi-image GIF files.

<IMG...>

The Image element is used to incorporate inline graphics (typically icons or small graphics) into an HTML document. This element cannot be used for embedding other HTML text.

Browsers that cannot render inline images ignore the <IMG...> element unless it contains the ALT attribute.

The <IMG...> element, which is empty (no closing element), has these attributes:

ALIGN

The ALIGN attribute accepts the values left, right, top, texttop, middle, absmiddle, baseline, bottom, and absbottom, which specify the alignment of the image and that of the following line of text.

Note
Not all browsers support the left and right alignment of images and will render embedded images on their own paragraph space in the browser window.

These attribute values to the ALIGN option require some explanation. First, the values left and right: Images with those alignments are floating image types.

ALIGN=left aligns the image on the left-hand edge of the browser display window and subsequent text wraps around the right-hand side of that image.

ALIGN=right aligns the image on the right-hand edge of the browser display window and subsequent text wraps around the left-hand side of that image.

The use of floating images and wraparound text can cause some formatting problems. Using <BR CLEAR=left|right|all> is recommended to achieve the desired page formatting effect.

ALIGN=top allows any text following the image to align itself with the top of the tallest item in the line (the top of the image).

ALIGN=texttop allows any text following the image to align itself with the top of the tallest text in the line (usually but not always the same as ALIGN=top).

ALIGN=middle aligns the baseline of the current line with the middle of the image.

ALIGN=absmiddle aligns the middle of the current line with the middle of the image.

ALIGN=baseline aligns the bottom of the image with the baseline of the current line.

ALIGN=bottom aligns the bottom of the image with the baseline of the current line.

ALIGN=absbottom aligns the bottom of the image with the bottom of the current line.

ALT

This attribute allows the setting of text as an alternative to the graphic for rendering in non-graphical environments or when the user has deactivated the auto-loading of images. Alternate text should be provided by the browser whenever the graphic is not rendered.

<IMG SRC="triangle.gif" ALT="Warning:"> Be sure to read these instructions.

Internet Explorer uses any ALT text that is set as a Tool Tip that is displayed whenever the mouse pauses over an image for which the ALT text has been specified.

BORDER=value

This lets the document author control the thickness of the border around an image displayed.

It is useful if the image is to be a hyperlink, because BORDER can be set to 0 to avoid the display of the standard blue hypertext link border.

ISMAP

The ISMAP (is map) attribute identifies an image as an imagemap. Imagemaps are graphics in which certain regions are mapped to other documents. By clicking on different regions, different resources can be accessed from the same graphic.

<A HREF="http://machine/htbin/imagemap/sample">
<IMG SRC="sample.gif" ISMAP></A>

Note
To be able to employ this type of imagemap in HTML documents, the HTTP server that will be controlling document access must have the correct cgi-bin software installed to control imagemap behavior. The document must have access to an imagemap-handling script and the mapfile defining the graphic hotspots.

Recent browsers allow a simpler form of imagemap known as client-side imagemaps. Although this is currently a proposed extension to HTML, it is widely supported by browsers. For details, see "Client-Side Imagemaps."

LOWSRC

Using the LOWSRC attribute, it is possible to use two images in the same space. The syntax is

<IMG SRC="hiquality.gif" LOWSRC="lowquality.gif">

Browsers that do not recognize the LOWSRC attribute ignore it and simply load the image specified by the SRC attribute.

Browsers that support this attribute load the image called lowquality.gif on their first layout pass through the document. When the rest of the document is completely loaded and formatted on the page, the browser redraws the page and loads the image specified by the standard SRC attribute. This allows the author to specify a low resolution (or smaller file size version of the main image- perhaps a grayscale version) image to be displayed initially while the document is loading, which later is replaced by the higher quality version.

Any graphics file format that the browser supports can be used interchangeably within the LOWSRC and SRC attributes. You also can specify width and/or height values in the IMG element, and both the high-resolution and low-resolution versions of the image are appropriately scaled to match. However, if no width and height values have been set, the values used for the LOWSRC image (the dimensions of that image) are used to rescale the SRC image. This is to minimize page format disruption caused by the browser trying to load two different-sized images into the same page space.

<IMG ALIGN="left" SRC="mosaic.gif" HSPACE="20" ALT="Mosaic logo">Mosaic,
from the <B>N</B>ational <B>C</B>entre for <B>S</B>upercomputing
<B>A</B>pplications represents the original graphical browser which
Netscape development was based on.
<BR CLEAR="all">
<HR>
<IMG ALIGN="right" SRC="netscape.gif" HSPACE="20" ALT="Netscape logo">Netscape,
from <B>Netscape Communications</B>, after initial development from Mosaic,
stormed away and became more or less the <I>de facto</I> Web browser.
<BR CLEAR="all">
<HR>
<IMG ALIGN="left" SRC="iexplore.gif" HSPACE="20" ALT="Internet Explorer logo">
Internet Explorer, from <B>Microsoft</B>, exhibits Microsoft's serious
intentions to enter the Web browser market and compete head-to-head with
Netscape.
<BR CLEAR="all">
<HR>

SRC

The value of the SRC attribute is the URL of the image to be displayed. Its syntax is the same as that of the HREF attribute of the <A> element. SRC is the only mandatory attribute of the <IMG> element. Image elements are allowed within anchors.

<IMG SRC ="warning.gif">Be sure to read these instructions.

The SRC attribute can accept fully qualified or partial relative URLs, or even just image names (if the image is located in the same directory as the HTML document).

VSPACE=value HSPACE=value

For the floating images (those displayed with an ALIGN=left|right attribute), it is likely that the author does not want the text wrapped around the image to be pressed up against the image. VSPACE controls the vertical space above and below the image, while HSPACE controls the horizontal space to the left and right of the image. Value should be a pixel value.

WIDTH=value HEIGHT=value

The WIDTH and HEIGHT attributes allow the browser to determine the text layout surrounding images before the entire image downloads, which can significantly speed up display of the document text. If the author specifies these, the viewer of the document will not have to wait for the image to be loaded over the network and its size calculated. Internet Explorer uses image-placement mechanisms, so that if the display of inline images has been turned off, the space that the images would occupy in the page is marked as if the image were there (with any ALT text being displayed in the placeholder). This allows authors to be sure that the text layout on the page will be as desired, even if the user is not displaying the images.

Client-Side Imagemaps

Before this imagemap method was implemented by browsers, using imagemaps required communication with the Web server on which the HTML documents were located in order to determine the action to be taken when an area of the image had been clicked on. This produced unnecessary server-side overheads. The client-side imagemap specification (designed by Spyglass) allows for all of the processing of the imagemap action to be done by the browser. It allows the use of imagemaps within HTML documents that are not being distributed by conventional means (from a Web server). For example, using client-side imagemaps allows imagemap functionality for HTML documents on CD-ROMs and so on.

Basically, adding the USEMAP attribute to an <IMG> element indicates that the image is a client-side imagemap. The USEMAP attribute can be used with the ISMAP attribute to indicate that the image can be processed as a client-side or server-side imagemap (useful to ensure browser independence of HTML documents). The value used in the USEMAP attribute specifies the location of the map definition to use with the image, in a format similar to the HREF attribute on anchors. If the argument to USEMAP starts with a #, the map description is assumed to be in the same document as the IMG tag.

<IMG SRC="../images/image.gif" USEMAP="maps.html#map1">

This uses the map described as map1 in maps.html as the overlay for the image file image.gif. The map definition can be included within the HTML document where the image is embedded or in a completely separate file.

The active regions of the image are described using MAP and AREA elements.

<MAP>

The map describes each region in the image and indicates the location of the document to be retrieved when the defined area is activated. The basic format for the MAP element follows:

<MAP NAME="name">
<AREA [SHAPE="shape"] COORDS="x,y,..." [HREF="reference"] [NOHREF]>
</MAP>

The name specifies the name of the map so that it can be referenced by an <IMG USEMAP=> element. The shape gives the shape of the specific area. Currently, the only shape defined is "RECT", but the syntax is defined to allow other region types to be added. If the SHAPE attribute is omitted, SHAPE="RECT" is assumed. The COORDS attribute gives the coordinates of the shape, using image pixels as the units. For a rectangle, the coordinates are given as "left,top,right,bottom". The rectangular region defined includes the lower-right corner specified; to specify the entire area of a 100x100 image, the coordinates are "0,0,99,99".

The NOHREF attribute indicates that clicks in this region should perform no action. An HREF attribute specifies where a click in that area should lead. Note that a relative anchor specification will be expanded using the URL of the map description as a base, instead of using the URL of the document from which the map description is referenced. If a BASE tag is present in the document containing the map description, that URL is used as the base to resolve partial URLs.

<AREA>

An arbitrary number of <AREA> elements may be specified. If two areas intersect, the one that appears first in the map definition takes precedence in the overlapping region. For example, a button bar in a document might use a 200 ¥ 80 pixel image and appear like this:

<MAP NAME="buttonbar">
<AREA SHAPE="RECT" COORDS="10,10,40,70" HREF="../index.html">
<AREA SHAPE="RECT" COORDS="60,10,90,70" HREF="../download.html">
<AREA SHAPE="RECT" COORDS="110,10,140,70" HREF="../email.html">
<AREA SHAPE="RECT" COORDS="160,10,190,70" HREF="../reference.html">
</MAP>
<IMG SRC="../images/tech/bar.gif" USEMAP="#buttonbar">

Note
The TARGET attribute can be used within the <AREA> element, allowing the use of client- side imagemaps within framed dcouments. For more information about the use of TARGET attributes, see the <FRAME> section.

Inline Video

Microsoft's Internet Explorer allows the user to embed .AVI (Audio Video Interleave) video clips in HTML documents. This is done by adding several new attributes, notably DYNSRC (dynamic source) to the <IMG> element. Using the IMG element for this purpose makes it possible to add video clips to page, but also have non-video-enabled browsers display still images in their place.

Note
In future versions of Internet Explorer, proprietary additions by Microsoft are to be deprecated (their support will be removed) in favor of open standard mechanisms for the embedding of objects, such as video and executable content. Netscape can support the embedding of video clips through its plugin mechanism using the <EMBED> element. See <EMBED> for more details.

CONTROLS

This attribute has no values. It is a flag that, if set, displays the standard Windows AVI Control Panel to allow the user to control the display of the video clip.

DYNSRC

This attribute specifies the address of a video clip to be displayed in the window. It stands for dynamic source.

<IMG SRC="filmclip.gif" DYNSRC="filmclip.avi">

Internet Explorer displays the movie filmclip.avi; other browsers display the image filmclip.gif.

The attributes used to control the playing of the video clip follow.

Note
Because the DYNSRC is an attribute of the IMG element, other attributes of the IMG element, such as HEIGHT, WIDTH, HSPACE, VSPACE, BORDER, and so on, also are acceptable, and if specified, will format the display window for the video clip.

Inline VRML Worlds

Note
As with other <IMG> related object embedding mechanisms (inline video), future versions of the Internet Explorer will support open standard object embedding mechanisms instead of relying on proprietary extensions.

Microsoft's Internet Explorer (from version 2) has added the capability to include inline embedded VRML viewable by installing the Virtual Explorer plugin module, available from the Microsoft Windows 95 Web site (http://www.microsoft.com/windows ). It does this by adding the VRML attribute to the <IMG> element.

As the attribute is used in the <IMG> element, it supports many of the other attributes of the <IMG> element, such as HEIGHT, WIDTH, VSPACE, HSPACE, and so on.

For example;

<IMG SRC="picture.gif" VRML="world.wrl" HEIGHT=250 WIDTH=300>

embeds the VRML world, world.wrl, into the HTML document, with the navigation controls below the embedding pane. The pane is displayed according to the dimensions specified. For browsers other than the Virtual Explorer (Internet Explorer with the VRML add-on), the picture picture.gif is displayed.

Note
Embedding of VRML worlds also is supported by Netscape, using the Netscape Live3D plugin module and the <EMBED> element. See <EMBED> for more details.

Information-Type and Character-Formatting Elements

The following information-type and character-formatting elements are supported by most browsers.

Note
Different information type elements may be rendered in the same way. The following are what are sometimes called Logical formatting elements. They suggest to the browser that the enclosed text should be rendered in a way set by the browser rather than physically fixing the display type. Elements that do this are character-formatting elements that produce strict rendering of the text.

Information-type elements:

<CITE>...</CITE>Citation
<CODE>...</CODE>An example of code
<EM>...</EM>Emphasis
<KBD>...</KBD>User typed text
<SAMP>...</SAMP>A sequence of literal characters
<STRONG>...</STRONG>Strong typographic emphasis
<VAR>...</VAR>Indicates a variable name
<!-- ... -->Defining comments

Character-formatting elements:

<B>...</B> Boldface type
<BIG>...</BIG> Big text
<BLINK>...</BLINK> Blinking text
<I>...</I> Italics
<SMALL>...</SMALL> Small text
<STRIKE>...</STRIKE>  
(or <S>...</S>) Strikethrough text
<SUB>...</SUB> Subscript
<SUP>...</SUP> Superscript
<TT>...</TT> TypeType (or Teletype)
<U>...</U> Underlined text

Although character-formatting elements (physical elements) may be nested within the content of other character-formatting elements, browsers are not required to render nested character-level elements distinctly from non-nested elements. For example,

plain <B>bold <I>italic</I></B>

may be rendered the same as

plain <B>bold </B><I>italic</I>

<!-- Comments -->

To include comments in an HTML document that will be ignored by the browser, surround them with <!-- and -->. After the comment delimiter, all text up to the next occurrence of --> is
ignored. Comments therefore cannot be nested. White space is allowed between the closing -- and >, but not between the opening <! and --. Comments can be used anywhere within an HTML document and generally are used as markers to improve the readability of complex HTML documents.

For example:

<HEAD>
<TITLE>The HTML Reference</TITLE>
<!-- Created by Stephen Le Hunte, April 1996 -->
</HEAD>

Note
Some browsers incorrectly consider a > sign to terminate a comment.

<B>...</B>

The bold element specifies that the text should be rendered in boldface, where available. Otherwise, alternative mapping is allowed.

The instructions <B>must be read</B> before continuing.

renders as

The instructions must be read before continuing.

<BIG>...</BIG>

The <BIG> element specifies that the enclosed text should be displayed, if practical, using a big font (compared with the current font). This is an HTML 3.0 element and may not be widely supported. For example,

This is normal text, with <BIG>this bit</BIG> being big text.

is rendered as

This is normal text, with this bit being big text.

Note
Use of this element currently is supported by Netscape and the Internet Explorer only. It also allows the <BIG>...</BIG> element to be used surrounding the <SUB>...</SUB> and <SUP>...</SUP> elements to force rendering of the sub/superscript text as normal size text as opposed to the default, slightly smaller text normally used.

The exact appearance of the big text changes depending on any <FONT SIZE=...> and <BASEFONT SIZE=...> settings, if specified.

<BLINK>

Surrounding any text with this element causes the selected text to blink on the viewing page. This can add extra emphasis to selected text.

<BLINK>This text would blink on the page</BLINK>

Note
The <BLINK>...</BLINK> element currently is supported only by Netscape.

<CITE>...</CITE>

The citation element specifies a citation and typically is rendered in an italic font. For example,

This sentence contains a <CITE>citation reference</CITE>

would look like this:

This sentence contains a citation reference

<CODE>...</CODE>

The code element should be used to indicate an example of code and typically is rendered in a monospaced font. This should not be confused with the preformatted text (<PRE>) element. For example,

The formula is: <CODE>x=(-b+/-(b^2-4ac)^1/2)/2a</CODE>

would look like this:

The formula is: x=(-b+/-(b^2-4ac)^1/2)/2a

<EM>...</EM>

The emphasis element indicates typographic emphasis and typically is rendered in an
italic font. For example,

The <EM>Emphasis</EM> element typically renders as Italics.

renders as

The Emphasis element typically renders as Italics.

<I>...</I>

The italic element specifies that the text should be rendered in italic font, where available. Otherwise, alternative mapping is allowed. For example,

Anything between the <I>I elements</I> should be italics.

renders as

Anything between the I elements should be italics.

<KBD>...</KBD>

The keyboard element can be used to indicate text to be typed by a user and typically is rendered in a monospaced font. It might commonly be used in an instruction manual. For example,

To login to the system, enter <KBD>"GUEST"</KBD> at the command prompt.

renders as

To login to the system, enter "GUEST" at the command prompt.

<SAMP>...</SAMP>

The sample element can be used to indicate a sequence of literal characters and typically is rendered in a monospaced font. For example,

A sequence of <SAMP>literal characters</SAMP> commonly renders in a monospaced

font.

renders as

A sequence of literal characters commonly renders in a mono spaced font.

<SMALL>...</SMALL>

The <SMALL> element specifies that the enclosed text should be displayed, if practical, using a small font (compared with the current font). This is an HTML 3.2 element and may not be widely supported. For example,

This is normal text, with <SMALL>this bit</SMALL> being small text.

rendereds as

This is normal text, with this bit being small text.

Note
Use of this element currently is supported by Netscape and the Internet Explorer only. They also allow the <SMALL>...</SMALL> element to be used surrounding the <SUB>...</SUB> and <SUP>...</SUP> elements to force rendering of the sub/superscript text as text even smaller than the default, slightly smaller (compared to the normal) text normally used.

The exact appearance of the small text changes depending on any <FONT SIZE=...> and <BASEFONT SIZE=...> settings, if specified.

<STRIKE>...</STRIKE>

The <STRIKE>...</STRIKE> element states that the enclosed text should be displayed with a horizontal line striking through the text. Alternative mappings are allowed if this is not practical. This is an HTML 3.2 element and may not be widely supported. For example,

This text would be <STRIKE>struck through</STRIKE>

renders as

This text would be struck through

Note
Although use of the <STRIKE> element currently is supported by Netscape and Mosaic, the element contained in current versions of the HTML 3.2 specification is <S>...</S>, which is supported by Mosaic but not Netscape. The Microsoft Internet Explorer supports either version of the element.

<STRONG>...</STRONG>

The strong element can be used to indicate strong typographic emphasis and typically is rendered in a bold font. For example,

The instructions <STRONG>must be read</STRONG> before continuing.

renders as

The instructions must be read before continuing.

<SUB>...</SUB>

The <SUB> element specifies that the enclosed text should be displayed as a subscript and, if practical, using a smaller font (compared with normal text). This is an HTML 3.2 element and may not be widely supported. For example,

This is the main text, with <SUB>this bit</SUB> being subscript.

renders as

This is the main text, with this bit being subscript.

Note
The selected text will be made a superscript to the main text, formatting the selected text slightly smaller than the normal text. Netscape and the Internet Explorer can be forced to make subscripts even smaller by compounding the <SUB>...</SUB> element with the <SMALL>...</SMALL> element or to render the subscript the same size as the normal text by compounding the <SUB>...</SUB> element with the <BIG>...</BIG> element.

The exact appearance of the subscript text changes depending on any <FONT SIZE=...> and <BASEFONT SIZE=...> settings, if specified.

<SUP>...</SUP>

The <SUP> element specifies that the enclosed text should be displayed as a superscript and, if practical, using a smaller font (compared with normal text). This is an HTML 3.2 element and may not be widely supported. For example,

This is the main text, with <SUP>this bit</SUP> being superscript.

renders as

This is the main text, with this bit being superscript.

Note
The selected text will be made a superscript to the main text, formatting the selected text slightly smaller than the normal text. Netscape and the Internet Explorer can be forced to make superscripts even smaller by compounding the <SUP>...</SUP> element with the <SMALL>...</SMALL> element or to render the superscript the same size as the normal text by compounding the <SUP>...</SUP> element with the <BIG>...</BIG> element.

The exact appearance of the superscript text changes depending on any <FONT SIZE=...> and <BASEFONT SIZE=...> settings, if specified.

<TT>...</TT>

The Teletype element specifies that the text be rendered in fixed-width typewriter font where available. Otherwise, alternative mapping is allowed. For example,

Text between the <TT> TypeType elements</TT> should be rendered in fixed width
typewriter font.

renders as

Text between the TypeType elements should be rendered in fixed-width typewriter font.

<U>...</U>

The <U> element states that the enclosed text should be rendered, if practical, underlined. This is an HTML 3.2 element and may not be widely supported. For example,

The <U>main point</U> of the exercise...

renders as

The main point of the exercise...

Note
Currently, Netscape doesn't support use of the <U> element.

<VAR>...</VAR>

The variable element can be used to indicate a variable name and typically is rendered in an italic font. For example,

When coding, <VAR>LeftIndent()</VAR> must be a variable

renders as

When coding, LeftIndent() must be a variable.

List Elements

HTML supports several types of lists, all of which may be nested. If used, they should be present in the <BODY> of an HTML document.

<DIR>...</DIR> Directory list
<DL>...</DL> Definition list
<MENU>...</MENU> Menu list
<OL>...</OL> Ordered list
<UL>...</UL> Unordered list

<DIR>...</DIR>

A directory list element can be used to present a list of items, which may be arranged in columns, typically 24 characters wide. Some browsers attempt to optimize the column width as a function of the widths of individual elements.

A directory list must begin with the <DIR> element, which is followed immediately by a <LI> (list item) element:

<DIR>
<LI>A-H
<LI>I-M
<LI>M-R
<LI>S-Z
</DIR>

<DL>...</DL>

Definition lists typically are rendered by browsers, with the definition term <DT> flush left in the display window with the definition data <DD> rendered in a separate paragraph, indented after the definition term. Individual browsers also may render the definition data on a new line, below the definition term.

Example of use:

<DL>
<DT>&lt;PRE&gt;<DD>Allows for the presentation of preformatted text.
<DT>&lt;P&gt;<DD>This is used to define paragraph blocks.
</DL>

The layout of the definition list is at the discretion of individual browsers. However, generally, the <DT> column is allowed one-third of the display area. If the term contained in the <DT> definition exceeds this in length, it may be extended across the page with the <DD> section moved to the next line, or it may be wrapped onto successive lines of the left-hand column.

Single occurrences of a <DT> element without a subsequent <DD> element are allowed and have the same significance as if the <DD> element had been present with no text.

The opening list element must be <DL> and must be followed immediately by the first term (<DT>).

The definition list type can take the COMPACT attribute, which suggests that a compact rendering be used, implying that the list data may be large in order to minimize inefficient display window space. Generally, this is displayed table-like, with the definition terms and data rendered on the same line.

<DL COMPACT>
<DT>&lt;PRE&gt;<DD>Allows for the presentation of preformatted text.
<DT>&lt;P&gt;<DD>This is used to define paragraph blocks.
</DL>

<MENU>...</MENU>

Menu lists typically are rendered as discrete items on a single line. It is more compact than the rendering of an unordered list. Typically, a menu list is rendered as a bulleted list, but this is at the discretion of the browser.

A menu list must begin with a <MENU> element, which is followed immediately by a <LI> (list item) element:

<MENU>
<LI>First item in the list.
<LI>Second item in the list.
<LI>Third item in the list.
</MENU>

<OL>...</OL>

The ordered list element is used to present a numbered list of items, sorted by sequence or order of importance, and typically is rendered as a numbered list, but this is as the discretion of individual browsers.

Note
The list elements are not sorted by the browser when displaying the list. (This sorting should be done manually when adding the HTML elements to the desired list text.) Ordered lists can be nested.

An ordered list must begin with the <OL> element, which is followed immediately by a <LI> (list item) element:

<OL>
<LI>Click on the desired file to download.
<LI>In the presented dialog box, enter a name to save the file with.
<LI>Click 'OK' to download the file to your local drive.
</OL>

The ordered list element can take the COMPACT attribute, which suggests that a compact rendering be used.

The average ordered list counts 1, 2, 3, ... and so on. The TYPE attribute allows authors to specify whether the list items should be marked with the following:

(TYPE=A) Capital letters. For example, A, B, C ...
(TYPE=a) Small letters. For example, a, b, c ...
(TYPE=I) Large roman numerals. For example, I, II, III ...
(TYPE=i) Small roman numerals. For example, i, ii, iii ...
(TYPE=1) The default numbers. For example, 1, 2, 3 ...

For lists that you want to start at values other than 1, the new attribute START is available.

START always is specified in the default numbers and is converted based on TYPE before display. Thus, START=5 displays an E, e, V, v, or 5, based on the TYPE attribute. For example, changing the preceding example to

<OL TYPE=a START=3>
<LI>Click on the desired file to download.
<LI>In the presented dialog box, enter a name to save the file with.
<LI>Click 'OK' to download the file to your local drive.
</OL>

presents the list as using lowercase letters, starting at c.

To give even more flexibility to lists, the TYPE attribute can be used with the <LI> element. It takes the same values as <OL>, and it changes the list type for that item and all subsequent items. For ordered lists, the VALUE attribute is also allowed, which can be used to set the count for that list item and all subsequent items.

Note
The TYPE attribute used in the <OL> element and the <LI> element and the START attribute in the <OL> element are supported only by Netscape and Internet Explorer.

<UL>...</UL>

The unordered list element is used to present a list of items that typically are separated by white space and/or marked by bullets, but this is as the discretion of individual browsers.

An unordered list must begin with the <UL> element, which is followed immediately by a <LI> (list item) element. Unordered lists can be nested.

<UL>
<LI>First list item
<LI>Second list item
<LI>Third list item
</UL>

The unordered list element can take the COMPACT attribute, which suggests that a compact rendering be used.

The basic bulleted list has a default progression of bullet types that change as you move through indented levels: from a solid disc to a circle to a square. The TYPE attribute can be used in the <UL> element so that no matter what the indent level, the bullet type can be specified as the following:

TYPE=disc
TYPE=circle
TYPE=square

To give even more flexibility to lists, the TYPE attribute to the <LI> element also is allowed. It takes the same values as <UL> and it changes the list type for that item and all subsequent items.

Note
The TYPE attribute, when used in the <UL> and <LI> elements, is supported by Netscape only.

Tables

At present, the table HTML elements are

<TABLE>...</TABLE> The table delimiter
<TR ...>...</TR> Specifies number of rows in a table
<TD ...>...</TD> Specifi table data cells
<TH ...>...</TH> Table header cell
<CAPTION ...>...</CAPTION> Specifies the table caption

Internet Explorer has introduced support for various HTML 3.0 table elements. Those introduced are

<THEAD>...</THEAD> Specifies the table head
<TBODY>...</TBODY> Specifies the table body
<TFOOT>...</TFOOT> Specifies the table footer
<COLGROUP>...</COLGROUP> Groups column alignments
<COL>...</COL> Specifies individual column alignments

Also, some new attributes have been introduced. These are

<TABLE BACKGROUND="..."> Specifies a background image for the table
<TH BACKGROUND="..."> Specifies a background image for the table header
<TD BACKGROUND="..."> Specifies a background image for a table data cell
<TABLE FRAME="..."> Specifies the appearance of the table frame
<TABLE RULES="..."> Specifies the appearance of the table dividing lines

<TABLE>...</TABLE>

This is the main wrapper for all the other table elements; other table elements are ignored if they aren't wrapped inside a <TABLE>...</TABLE> element. By default, tables have no borders; borders are added if the BORDER attribute is specified.

The <TABLE> element has the following attributes.

ALIGN="left|right"

Some browsers (Internet Explorer and Netscape) support the ALIGN attribute to the <TABLE> element. Like that used for floating images, it allows a table to be aligned to the left or right of the page, allowing text to flow around the table. Also, as with floating images, it is necessary to have knowledge of the <BR CLEAR=...> element to be able to organize the text display to minimize poor formatting.

BACKGROUND

Internet Explorer supports the placement of images in the <TABLE> element (also in the <TD> and <TH> elements). If used in the <TABLE> element, the image in question is tiled behind all the table cells. Any of the supported graphics file formats can be used as a graphic behind a table.

BGCOLOR="#rrggbb|color name"

Internet Explorer and Netscape support use of this attribute (also supported in the <BODY> element). It allows the background color of the table to be specified, using the specified color names or an rrggbb hexadecimal triplet.

BORDER

This attribute can be used to control and set the borders to be displayed for the table. If present, a border is drawn around all data cells. The exact thickness and display of this default border is at the discretion of individual browsers. If the attribute isn't present, the border is not displayed, but the table is rendered in the same position as if there were a border (allowing room for the border). It also can be given a value, BORDER=<value>, which specifies the thickness of the table border. The border value can be set to 0, which regains all the space that the browser has set aside for any borders (as in the case where no border has been set).

BORDERCOLOR="#rrggbb|color name"

Internet Explorer includes support for this attribute, which sets the border color of the table. Any of the predefined color names can be used, as well as any color defined by an rrggbb hexadecimal triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border coloring to work.

BORDERCOLORDARK="#rrggbb|color name"

Internet Explorer enables you to use the BORDERCOLORDARK attribute to set the darker color to be displayed on a 3-D <TABLE> border. It is the opposite of BORDERCOLORLIGHT. Any of the predefined color names can be used, as well as any color defined by an rrggbb hexadecimal triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border coloring to work.

Note
The BGCOLOR, BORDERCOLOR, BORDERCOLORLIGHT, and BORDERCOLORDARK attributes also can be used in <TH>, <TR>, and <TD> elements, with the color defined in the last element over-riding those defined before. For example, if a <TD> element contains a BORDERCOLOR attribute setting, the setting specified will be used instead of any color settings that may have been specified in the <TR> element, which over-rides any color settings in the <TABLE> element.

BORDERCOLORLIGHT="#rrggbb|color name"

Internet Explorer enables you to use the BORDERCOLORLIGHT attribute to set, the lighter color to be displayed on a 3-D <TABLE> border. It is the opposite of BORDERCOLORDARK. Any of the predefined color names can be used, as well as any color defined by an rrggbb hexadecimal triplet. It is necessary for the BORDER attribute to be present in the main <TABLE> element for border coloring to work.

CELLPADDING=value

The CELLPADDING is the amount of white space between the borders of the table cell and the actual cell data (whatever is to be displayed in the cell). It defaults to an effective value of 1. This example gives the most compact table possible:

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>

CELLSPACING=value

The CELLSPACING is the amount of space inserted between individual table data cells. It defaults to an effective value of 2.

FRAME

Only Internet Explorer supports the use of this attribute. It requires the BORDER attribute to be set and affects the display of the table borders. It can accept any of the following values:

void Removes all the external borders
above Displays external borders at the top of the table only
below Displays external borders at the bottom of the table only
hsides Displays external borders at the horizontal sides of the table-at the top and bottom of the table
lhs Displays external borders at the left-hand edge of the table only
rhs Displays external borders at the right-hand edge of the table only
vsides Displays external borders at both left-and right-hand edges of the table
box Displays a box around the table (top, bottom, left-and right-hand sides)

HEIGHT=value_or_percent

If used, this attribute can specify the exact height of the table in pixels or the height of the table as a percentage of the browser display window.

RULES

Internet Explorer supports this new attribute. It requires the BORDER value to be set and may only be used in tables where the <THEAD>, <TBODY>, and <TFOOT> sections have been set. It affects the display of the internal table borders (rules). It can accept the following values:

none Removes all the internal rules
basic Displays horizontal borders between the <THEAD>, <TBODY>, and <TFOOT> sections
rows Displays horizontal borders between all rows
cols Displays horizontal borders between all columns
all Displays all the internal rules

VALIGN="top|bottom"

The Internet Explorer supports this attribute that specifies the vertical alignment of the text displayed in the table cells. The default, which is used if the attribute is not set, is center aligned.

WIDTH=value_or_percent

If used, this attribute can specify the exact width of the table in pixels or the width of the table as a percentage of the browser display window.

<CAPTION ...>...</CAPTION>

This represents the caption for a table. <CAPTION> elements should appear inside the <TABLE> but not inside table rows or cells. The caption accepts an alignment attribute that defaults to ALIGN=top but can be explicitly set to ALIGN=bottom. Like table cells, any document body HTML can appear in a caption. Captions by default are horizontally centered with respect to the table, and they may have their lines broken to fit within the width of the table.

The <CAPTION> element can accept the following attributes.

ALIGN="top|bottom|left|center|right"

The ALIGN attribute controls whether the caption appears above or below the table, using the top and bottom values, defaulting to top. The Internet Explorer allows the <CAPTION> element to be left, right, or center aligned. For the Internet Explorer to set the <CAPTION> at the top or bottom of the table, it is necessary to use the VALIGN attribute.

VALIGN="top|bottom"

The Internet Explorer allows use of the VALIGN attribute inside the <CAPTION> element. It specifies whether the caption text should be displayed at the top or bottom of the table.

<COL>...</COL>

This element, which is Internet Explorer specific, can be used to specify the text alignment for table columns. It accepts the following attributes.

<COLGROUP>...</COLGROUP>

This element, which is Internet Explorer specific, can be used to group columns to set their alignment properties. It accepts the following attributes:

<TBODY>...</TBODY>

This element, which is Internet Explorer specific, is used to specify the body section of the table. It is somewhat analogous to the <BODY> element. It directly affects the rendering of the table on-screen, but is required if you want RULES to be set in the <TABLE> .

<TD ...>...</TD>

This stands for table data, and specifies a standard table data cell. Table data cells must only appear within table rows. Each row need not have the same number of cells specified because, short rows will be padded with blank cells on the right. A cell can contain any of the HTML elements normally present in the body of an HTML document.

Internet Explorer allows the use of <TD></TD> to specify a blank cell, that will be rendered with a border (if a border has been set). Other browsers require some character within a data cell for it to be rendered with a border.

<TD ...>...</TD> can accept the following attributes:

Note
The BGCOLOR, BORDERCOLOR, BORDERCOLORDARK, and BORDERCOLORLIGHT attributes also can be used in <TABLE>, <TH>, and <TR> elements, with the color defined in the last element over-riding those defined before. For example, if a <TD> element contains a BORDERCOLOR attribute setting, the setting specified is used instead of any color settings that may have been specified in the <TR> element, which in turn overrides any color settings in the <TABLE> element.

<TFOOT>...</TFOOT>

This element, which is Internet Explorer specific, is used to specify the footer section of the table. It directly affects the rendering of the table on-screen, but is required if you want RULES to be set in the <TABLE> .

<TH ...>...</TH>

This stands for table header. Header cells are identical to data cells in all respects, with the exception that header cells are in a bold font and have a default ALIGN=center.

<TH ...>...</TH> can contain the following attributes:

Note
The BGCOLOR, BORDERCOLOR, BORDERCOLORDARK, and BORDERCOLORLIGHT attributes also can be used in <TABLE>, <TD>, and <TR> elements, with the color defined in the last element over-riding those defined before. For example, if a <TD> element contains a BORDERCOLOR attribute setting, the setting specified is used instead of any color settings that may have been specified in the <TR> element, which overrides any color settings in the <TABLE> element.

<THEAD>...</THEAD>

This element, which is Internet Explorer specific, is used to specify the head section of the table. It is somewhat similar to the <HEAD> element. It does directly affect the rendering of the table on-screen, but is required if you want RULES to be set in the <TABLE> .

<TR ...>...</TR>

This stands for table row. The number of rows in a table is exactly specified by how many <TR> elements are contained within it, regardless of cells that may attempt to use the ROWSPAN attribute to span into non-specified rows.

The <TR> element can have the following attributes:

Note
The BGCOLOR, BORDERCOLOR, BORDERCOLORLIGHT, and BORDERCOLORDARK attributes also can be used in <TABLE>, <TH>, and <TD> elements, with the color defined in the last element over-riding those defined before. If a <TD> element contains a BORDERCOLOR attribute setting, the setting specified is used instead of any color settings that may have been specified in the <TR> element, which overrides any color settings in the <TABLE> element.

Table Examples

Here are some sample HTML <TABLE> fragments with accompanying screenshots.

A Simple Table

<TABLE BORDER>
<TR>
<TD>Data cell 1</TD><TD>Data cell 2</TD>
</TR>
<TR>
<TD>Data cell 3</TD><TD>Data cell 4</TD>
</TR>
</TABLE>

Figure B.2: A simple four-cell table.

A Table Using ROWSPAN

<TABLE BORDER>
<TR>
<TD ROWSPAN=2>This cell spans two rows</TD>
<TD>These cells</TD><TD>would</TD>
</TR>
<TR>
<TD>contain</TD><TD>other data</TD>
</TR>
</TABLE>
Figure B.3: A table with spanning rows.

A Table Using COLSPAN

<TABLE BORDER>
<TR>
<TD>Data cell 1</TD>
<TD COLSPAN=2>This cell spans 2 columns</TD>
</TR>
<TR>
<TD>Data cell 2</TD><TD>Data cell 3</TD><TD>Data cell 4</TD>
</TR>
</TABLE>
Figure B.4: A table with spanning columns.

A Table Using Headers

<TABLE BORDER>
<TR>
<TH>Netscape</TH><TH>Internet Explorer</TH><TH>Mosaic</TH>
</TR>
<TR>
<TD>X</TD><TD>X</TD><TD>-</TD>
</TR>
<TR>
<TD>X</TD><TD>-</TD><TD>X</TD>
</TR>
</TABLE>
Figure B.5: Table headers.

A Table Using All of the Above

<TABLE BORDER>
<TR>
<TD><TH ROWSPAN=2></TH>
<TH COLSPAN=3>Browser</TH></TD>
</TR>
<TR>
<TD><TH>Netscape</TH><TH>Internet Explorer</TH><TH>Mosaic</TH></TD>
</TR>
<TR>
<TH ROWSPAN=2>Element</TH>
<TH>&lt;DFN&gt;</TH><TD>-</TD><TD>X</TD><TD>-</TD>
</TR>
<TR>
<TH>&lt;DIR&gt;</TH><TD>X</TD><TD>X</TD><TD>X</TD>
</TR>
</TABLE>

Figure B.6: A complex table.

A Table Using ALIGN/VALIGN

This table adds ALIGN and VALIGN attributes to the preceding example to improve the layout of the table.

<TABLE BORDER>
<TR>
<TD><TH ROWSPAN=2></TH>
<TH COLSPAN=3>Browser</TH></TD>
</TR>
<TR>
<TD><TH>Netscape</TH><TH>Internet Explorer</TH><TH>Mosaic</TH></TD>
</TR>
<TR>
<TH ROWSPAN=2 VALIGN=top>Element</TH>
<TH>&lt;DFN&gt;</TH>
<TD ALIGN=center>-</TD>
<TD ALIGN=center>X</TD>
<TD ALIGN=center>-</TD>
</TR>
<TR>
<TH>&lt;DIR&gt;</TH>
<TD ALIGN=center>X</TD>
<TD ALIGN=center>X</TD>
<TD ALIGN=center>X</TD>
</TR>
</TABLE>
Figure B.7: Improving the layout of a table.

Nested Tables

To show that tables can be nested within each other. This table uses the ROWSPAN table, including the simple table inside one of the data cells.

<TABLE BORDER>
<TR>
<TD ROWSPAN=2>This cell spans two rows
<TABLE BORDER>
<TR>
<TD>Data cell 1</TD><TD>Data cell 2</TD>
</TR>
<TR>
<TD>Data cell 3</TD><TD>Data cell 4</TD>
</TR>
</TABLE>
</TD>
<TD>These cells</TD><TD>would</TD>
</TR>
<TR>
<TD>contain</TD><TD>other data</TD>
</TR>
</TABLE>
Figure B.8: Nesting one table inside another.

Floating Tables

<TABLE ALIGN=left BORDER WIDTH=50%>
<TR>
<TD>This is a two row table</TD>
</TR>
<TR>
<TD>It is aligned to the left of the page</TD>
</TR>
</TABLE>
This text will be to the right of the table, and will fall neatly beside the table
<BR CLEAR=all>
<HR>
<TABLE ALIGN=right BORDER WIDTH=50%>
<TR>
<TD>This is a two row table</TD>
</TR>
<TR>
<TD>It is aligned to the right of the page</TD>
</TR>
</TABLE>
This text will be to the left of the table, and will fall neatly beside the table
<BR CLEAR=all>
<HR>
Figure B.9: Tables that can float in the document.

A Colored Table

<TABLE BORDER BGCOLOR=Silver BORDERCOLOR=Black WIDTH=50%>
<TR>
<TD>This is the first cell</TD>
<TD>This is the second cell</TD>
</TR>
<TR BORDERCOLOR=Red BGCOLOR=Green>
<TD>This is the third cell</TD>
<TD>This is the fourth cell</TD>
</TR>
<TR BORDERCOLOR=Red BGCOLOR=Green>
<TD BORDERCOLOR=Yellow>This is the fifth cell</TD>
<TD BGCOLOR=White>This is the sixth cell</TD>
</TR>
</TABLE>
Figure B.10: Color can be added to cells.

An HTML 3.2 Table

Note
The following HTML table is at present only supported by Internet Explorer.

<TABLE BORDER FRAME=hsides RULES=cols>
<COL ALIGN=left>
<COLGROUP SPAN=3 ALIGN=center VALIGN=middle>
<THEAD>
<CAPTION ALIGN=center><FONT SIZE=+1><B>A section of the Comparison Table</B>
</FONT>
</CAPTION>
<TR>
<TD>Element</TD><TD><B>Internet Explorer</B></TD><TD><B>Netscape</B>
</TD><TD><B>Mosaic</B></TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>&lt;B&gt;</TD><TD>X</TD><TD>X</TD><TD>X</TD>
</TR>
<TR>
<TD>&lt;BASE ...&gt;</TD><TD>X</TD><TD>X</TD><TD>X</TD>
</TR>
<TR>
<TD>  ...HREF</TD><TD>X</TD><TD>X</TD><TD>X</TD>
</TR>
<TR>
<TD>  ...TARGET</TD><TD>X</TD><TD>X</TD><TD></TD>
</TR>
<TR>
<TD>&lt;BASEFONT ...&gt;</TD><TD>X</TD><TD>X</TD><TD></TD>
</TR>
<TR>
<TD VALIGN=top>  ...SIZE</TD><TD>X<BR><FONT SIZE=-1>(only visible<BR>when FONT<BR>SIZE= used<BR>as well)</FONT></TD><TD VALIGN=top>X</TD><TD></TD>
</TR>
<TR>
<TD>  ...FACE</TD><TD>X</TD><TD></TD><TD></TD>
</TR>
<TR>
<TD VALIGN=top>&lt;BGSOUND ...&gt;</TD><TD VALIGN=top>X</TD><TD>
</TD><TD>X<BR><FONT SIZE=-1>(will spawn<BR>player for<BR>.mid files)
</FONT></TD>
</TR>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
Figure B.11: A complex table created for Internet Explorer.