P>The following example uses all the IMG attributes to improve performance:
<IMG SRC="http://www.HomeWorld.com/logo.gif" LOWSRC="http://www.HomeWorld.com/lowlogo.jpg" ALT="Welcome to Netscape" WIDTH="468" HEIGHT="25" BORDER="0">
This example uses the following attributes to improve performance:
Example 2: text wrapping around an image
In this example, an image is aligned on the right side of the Navigator window, and text flows around it to the left: _IMG SRC="tags2a6.gif" HEIGHT=146 WIDTH=505>
The following HTML code creates the image alignment and text wrap shown in the previous illustration:
<IMG SRC="logo.jpg" ALIGN="right" ALT="Welcome to Netscape" HSPACE="10" VSPACE="5"> <BIG><B>W</B></BIG>e are committed to ensuring that our customers receive answers to their questions and that they enjoy trouble-free use of our products.<P>
In this example, the HSPACE attribute creates a 10-pixel margin below the image, and the VSPACE attribute creates a 5-pixel margin to the left.
The INPUT tag lets you create input fields inside a form. An input field lets the user enter information on an HTML form. The TYPE attribute determines the specific sort of form element to be created:
In addition to the fields defined using INPUT, two types of input fields--selection lists and textarea elements--are defined using the SELECT and TEXTAREA tags.
<INPUT TYPE="BUTTON"
NAME="buttonName" required
VALUE="buttonText"
ONCLICK="JScode"
>
NAME="buttonName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONCLICK="JScode" specifies JavaScript code to execute when a user clicks the button. See the JavaScript Guide for information on event handlers.
VALUE="buttonText" specifies the text to be displayed on the button.
The following example is a JavaScript example that creates a button named CalcButton. The text "Calculate" is displayed on the face of the button. When the button is clicked, the function CalcFunction() is called.
<FORM> <INPUT TYPE="button" VALUE="Calculate" NAME="CalcButton" onClick="CalcFunction(this.form)"> </FORM>
_IMG SRC="tags2a7.gif" HEIGHT=105 WIDTH=379>
<INPUT TYPE="CHECKBOX"
CHECKED
NAME="checkboxName" required
ONCLICK="JScode"
VALUE="checkboxValue"
>
textToDisplay
CHECKED indicates that the checkbox is selected.
NAME="checkboxName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONCLICK="clickJScode" specifies JavaScript code to execute when a user clicks the checkbox. See the JavaScript Guide for information on event handlers.
textToDisplay specifies the label to display next to the checkbox.
VALUE="checkboxValue" specifies the value to be returned to the server when the checkbox is selected and the form is submitted. The default value is ON.
The following example displays a group of four checkbooks that all appear checked by default.
<FORM> <B>Specify your music preferences (check all that apply):</B> <BR><INPUT TYPE="checkbox" NAME="musicpref_rnb" CHECKED> R&B <BR><INPUT TYPE="checkbox" NAME="musicpref_jazz" CHECKED> Jazz <BR><INPUT TYPE="checkbox" NAME="musicpref_blues" CHECKED> Blues <BR><INPUT TYPE="checkbox" NAME="musicpref_newage" CHECKED> New Age </FORM>
_IMG SRC="tags2a8.gif" HEIGHT=158 WIDTH=377>
<INPUT TYPE="FILE"
NAME="name" required
VALUE="value"
>
NAME="name" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
VALUE="value" specifies the initial value of the input element.
The following example creates a file upload element.
<FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD="POST"> <B>First name:</B><INPUT TYPE="text"> <BR><B>Last name:</B><INPUT TYPE="text"> <P><B>Brief description of the problem:</B> <BR><INPUT TYPE="text" SIZE="45"> <P><B>Please attach a file with your event log.</B> <BR><B>File name:</B><INPUT TYPE="file"> <P><INPUT TYPE="submit" VALUE="Submit Report"> <INPUT TYPE="button" VALUE="Cancel" onClick="window.close()"> </FORM>
_IMG SRC="tags2a9.gif" HEIGHT=247 WIDTH=462>
<INPUT TYPE="HIDDEN"
NAME="hiddenName" required
VALUE="hiddenValue"
>
NAME="hiddenName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form. This tag provides a mechanism for delivering a value to the server without the user having entered it, but note that it is not very "hidden" because the user can discover it by using the View|Document Source sequence.
VALUE="hiddenValue" specifies the initial value of the input element.
This example creates a form called LoginForm that contains text fields for user name and password, a submit button with the text "Log in" displayed on its face, and a cancel button. A hidden element, DefaultPass, stores the initial value of the password field.
<FORM NAME="LoginForm"> <B>User name:</B> <INPUT TYPE="text" NAME="userName" SIZE="10"> <P><B>Password:</B> <INPUT TYPE="password" NAME="password" SIZE="12" VALUE="treasure"> <INPUT TYPE="hidden" NAME="DefaultPass" VALUE="treasure"> <P><INPUT TYPE="submit" VALUE="Log in"> <INPUT TYPE="button" VALUE="Cancel" onClick="window.close()"> </FORM>
_IMG SRC="tags2a10.gif" HEIGHT=167 WIDTH=375>
<INPUT TYPE="IMAGE"
ALIGN="LEFT"|"RIGHT"|"TOP"|"ABSMIDDLE"|"ABSBOTTOM"|
"TEXTTOP"|"MIDDLE"|"BASELINE"|"BOTTOM"
NAME="name"
SRC="Location"
>
ALIGN specifies the alignment of the image in relation to the surrounding text. If you do not specify a value for ALIGN, Navigator uses "BOTTOM" as the default.Navigator 1.1
NAME="name" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form. When Navigator sends the offsets of the image to the server, it sends them as name.x and name.y.
SRC="Location" specifies the URL of the image to be displayed in the document.
This example creates an image element. When the user clicks the image, the form is submitted.
<FORM> ... <CENTER><INPUT TYPE="image" SRC="signnow.gif"></CENTER> ... </FORM>
<INPUT TYPE="PASSWORD"
MAXLENGTH="maxChar"
NAME="passwordName" required
ONSELECT="jJScode"
SIZE="charsLength"
VALUE="textValue"
>
MAXLENGTH="maxChar" specifies the maximum number of characters a password box can accept.
NAME="passwordName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONSELECT="JScode" specifies JavaScript code to execute when a user selects some of the text in the text element. See the JavaScript Guide for information on event handlers.
SIZE="charsLength" specifies the length of the input field, in characters . When TYPE="text" or TYPE="password", value is the width, specified in characters, of the input field.
VALUE="textValue" specifies the initial value of the password, if any.
This example shows a password element. If the user enters a password containing more than 25 characters, the text scrolls to make room for the additional characters.
<FORM> <B>Password:</B> <INPUT TYPE="password" NAME="password" VALUE="" SIZE="25"> </FORM>
<INPUT TYPE="RADIO"
CHECKED
NAME="radioName" required
ONCLICK="JScode"
VALUE="buttonValue" required
>
textToDisplay
CHECKED indicates that the rradio button is selected. .
NAME="radioName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form. All radio buttons that have the same name constitute a radio group; only one radio button of a group can be set at one time.
ONCLICK="clickJScode" specifies JavaScript code to execute when a user clicks the radio button. See the JavaScript Guide for information on event handlers.
textToDisplay specifies the label to display next to the radio button.
VALUE="value" specifies the value that is returned to the server when the radio button is selected and the form is submitted. This defaults to ON.
The following example creates a radio button group.
<FORM> <B>Category:</B> <BR><INPUT TYPE="radio" NAME="category" VALUE="liv" CHECKED> Living <BR><INPUT TYPE="radio" NAME="category" VALUE="din"> Dining <BR><INPUT TYPE="radio" NAME="category" VALUE="bed"> Bedroom <BR><INPUT TYPE="radio" NAME="category" VALUE="bth"> Bath <BR><INPUT TYPE="radio" NAME="category" VALUE="grd"> Garden <BR><INPUT TYPE="radio" NAME="category" VALUE="shp"> Shop </FORM>
_IMG SRC="tags2a11.gif" HEIGHT=186 WIDTH=378>
<INPUT TYPE="RESET"
NAME="resetName" required
ONCLICK="JScode"
VALUE="buttonText"
>
NAME="resetName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONCLICK="JScode" specifies JavaScript code to execute when a user clicks the button. See the JavaScript Guide for information on event handlers.
VALUE="buttonText" specifies the text to display on the face of the reset button. .
This example displays a text element with the default value "CA" and a reset button with the text "Clear Form" displayed on its face. If the user types a state abbreviation in the text element and then clicks the Clear Form button, the original value of "CA" is restored.
<FORM> <B>State: </B><INPUT TYPE="text" NAME="state" VALUE="CA" SIZE="2"> <P><INPUT TYPE="reset" VALUE="Clear Form"> </FORM>
_IMG SRC="tags2a12.gif" HEIGHT=136 WIDTH=377>
<INPUT TYPE="SUBMIT"
NAME="submitName" required
VALUE="buttonText"
>
NAME="submitName" specifies the name of the input element. The name is not displayed on the form.
VALUE="buttonText" specifies the text to display on the face of the submit button.
The following example creates a submit button called SubmitButton. The text "Done" is displayed on the face of the button.
<FORM> <INPUT TYPE="submit" NAME="SubmitButton" VALUE="Done"> </FORM>
_IMG SRC="tags2a13.gif" HEIGHT=105 WIDTH=377>
<INPUT TYPE="TEXT"
MAXLENGTH="maxChar"
NAME="textName" required
ONBLUR="blurJScode"
ONCHANGE="changeJScode"
ONFOCUS="focusJScode"
ONSELECT="JScode"
SIZE="lengthChar"
VALUE="textValue"
>
MAXLENGTH="maxChar" specifies the maximum number of characters a text box can accept.
NAME="textName" specifies the name of the input element. This value is the name portion of the name=value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONBLUR="blurJScode" specifies JavaScript code to execute when the text element loses focus. See the JavaScript Guide for information on event handlers.
ONCHANGE="changeJScode" specifies JavaScript code to execute when the text element loses focus and its value has been modified. See the JavaScript Guide for information on event handlers.
ONFOCUS="focusJScode" specifies JavaScript code to execute when a user clicks the text element. See the JavaScript Guide for information on event handlers.
ONSELECT="JScode" specifies JavaScript code to execute when a user selects some of the text in the text element. See the JavaScript Guide for information on event handlers.
SIZE="lengthChar" specifies the length of the input field, in characters . When TYPE="text" or TYPE="password", value is the width, specified in characters, of the input field.
VALUE="textValue" specifies the initial value of the text element.
The following example creates a text element that is 25 characters long. The text field appears immediately to the right of the words "Last name:". The text field is blank when the form loads.
<FORM> <B>Last name:</B> <INPUT TYPE="text" NAME="last_name" VALUE="" SIZE="25"> </FORM>
_IMG SRC="tags2a14.gif" HEIGHT=112 WIDTH=377>
The ISINDEX tag indicates that the document has a searchable index. An HTML index document can be read and queried using a keyword search, if the server has access to a search engine. Generally, documents with the ISINDEX tag include a user interface element (such as a button) or a prompt to initiate the search. You can control the text that appears as part of the search by using the PROMPT attribute.
The keywords are passed to the server by adding a question mark to the end of the URL followed by a list of keywords separated by a plus sign. For example:
http://www.acme.com/products/index.htm?inventory+ordering+shipping
Note that ISINDEX does not require a closing tag.
PROMPT="text" specifies the text that appears as the search prompt in the browser. Navigator 1.1
The following example uses the ISINDEX tag.
<HEAD> <ISINDEX> <TITLE> Finding the Perfect Glaze </TITLE> </HEAD> <BODY> <FORM> <INPUT TYPE="SUBMIT" NAME="SubmitButton" VALUE="Search"> </FORM> </BODY>
_IMG SRC="tags2a15.gif" HEIGHT=165 WIDTH=380>
The KBD tag indicates text that is a keyboard key. Netscape Navigator displays the specified text in the current fixed-width font as determined by the font setting (Options|General Preferences).
The <KBD>ENTER</KBD> key lets you ...
_IMG SRC="tags2a16.gif" HEIGHT=88 WIDTH=378>
The KEYGEN tag facilitates the generation of key material and submission of the public key as part of an HTML form. This mechanism is designed for use in web-based certificate management systems. It displays a menu of key-size choices from which the user must choose one. Then, when the submit button is pressed, a key pair of the selected size is generated. The private key is encrypted and stored in the local key database.
The public key and challenge string are DER encoded as PublicKeyAndChallenge, and then digitally signed with the private key to produce a SignedPublicKeyAndChallenge. The SignedPublicKeyAndChallenge is base64 encoded, and the ASCII data is finally submitted to the server as the value of a name-value pair, where the name is name as specified by the NAME attribute of the KEYGEN tag.
<KEYGEN
NAME="name" required
CHALLENGE="challenge"
>
NAME="name" specifies the name for the name-value pair.
CHALLENGE="challenge" specifies the challenge string to be packaged with the public key in the PublicKeyAndChallengefor use in verification of the form submission. If no challenge string is provided, then it is encoded as an IA5STRING of length zero.
<FORM.....> ... <KEYGEN NAME="somekey" CHALLENGE="1125983021"> ... </FORM>
The LI tag indicates an item in a list. A single list item can contain additional paragraphs, marked with the P tag.
The LI tag does not require a closing tag.
<LI
TYPE=
"DISC"|"CIRCLE"|"SQUARE" | within
UL
"A"|"a"|"I"|"i"|"1" within
OL
VALUE="number"
>
TYPE specifies the type of symbol or numbering sequence to use before each item.
DISC specifies a solid bullet
CIRCLE specifies a hollow bullet
SQUARE specifies a square bullet
A specifies a sequence of uppercase letters
a specifies a sequence of lowercase letters
I specifies a sequence of uppercase Roman numerals
i specifies a sequence of lowercase Roman numerals
1 specifies a sequence of numbers.
VALUE="number" indicates the starting number for an item in a numbered list. This attribute is valid only in an ordered list. See "OL (ordered list)" on page 131 for information on the types of numbering available.
The following example defines three HTML terms. Note the use of < and > as one way to represent the less-than and greater-than characters.
The <LI> tag allows you to:<P> <UL> <LI>Identify items in a numbered list <LI>Identify items in an unordered list <LI>Identify items in a directory list <LI>Identify items in a menu </UL>
_IMG SRC="tags2a17.gif" HEIGHT=168 WIDTH=375>
An image map is a graphic that contains hyperlinks. The image map can be divided into many regions, and each region of the map can point to a different URL. When a user clicks a specific region of the image map, Navigator loads a specific URL.
Client-side image maps are defined by the MAP and AREA tags and loaded into the Navigator as hypergraphics. When a user clicks the image, Navigator determines what URL to load based on the information in the AREA tag. The USEMAP attribute of the IMG tag specifies an image as a client-side image map.
<MAP
NAME="mapName" required
>
...
</MAP>
NAME="mapName" specifies the name of the map.
In this example, an image map is used as a toolbar to help users navigate in a web site. The following illustration shows what the finished image map looks like to a user: _IMG SRC="tags2a18.gif" HEIGHT=80 WIDTH=612>
Each button on the toolbar is a separate region of the image map. The seven buttons correspond to regions defined by seven AREA tags. The following code defines the map:
<MAP NAME="mainmap"> <AREA COORDS="0,0,65,24" HREF="/escapes/index.html"> <AREA COORDS="66,0,132,24" HREF="/comprod/index.html"> <AREA COORDS="133,0,185,24" HREF="http://merchant.netscape.com/netstore/index.html" TARGET="_top"> <AREA COORDS="186,0,248,24" HREF="/newsref/index.html"> <AREA COORDS="249,0,318,24" HREF="/assist/index.html"> <AREA COORDS="319,0,390,24" HREF="/commun/index.html"> <AREA COORDS="391,0,467,24" HREF="/business_solutions/index.html"> </MAP>
Because no SHAPE attribute is specified for any AREA tag, the shape of each region defaults to a rectangle. The third AREA tag uses the "_top" value for its TARGET attribute to specify that its URL is loaded into the full Navigator window.
The image used for the toolbar is nav.gif, an interlaced GIF. The IMG tag that loads nav.gif uses the USEMAP attribute to specify that the image is a client-side image map. The value of the USEMAP attribute, mainmap, is also the value used for the NAME attribute of the MAP tag. The following code associates the map with the image:
<IMG SRC="nav.gif" WIDTH="468" HEIGHT="25" BORDER="0" USEMAP="#mainmap">
Deprecated
The MENU tag defines a list of simple items, such as you would use to create a menu. This tag works just like the UL tag. The items should be short, no longer than one line. Each is begun by the <LI> tag.
The following example creates a simple menu.
Netscape Navigator supports these platforms:
<MENU> <LI> UNIX <LI> Windows <LI> Macintosh </MENU>
_IMG SRC="tags2a19.gif" HEIGHT=128 WIDTH=378>
The META tag specifies meta-document information or creates an HTTP response header. The META tag provides a way to store information about the document that is not available elsewhere in the document. For example, the META tag can contain catalog, author, or index information that various search engines can use.
The META tag creates a special HTTP response header that the server sends to the client before transmitting the HTML document. This form of the META syntax is frequently used to implement client pull.
When you create an HTTP header with META, do not override a response header field that is normally returned by the server. Use META to create a special response header field, such as a "refresh" field that implements client pull.
<META
CONTENT="value" required
HTTP-EQUIV="FieldName"
NAME="name"
>
CONTENT="FieldContent" specifies the value of the HTTP response header field created by HTTP-EQUIV.Navigator 1.1
HTTP-EQUIV="FieldName" specifies the name of the HTTP response header field.
NAME="name" specifies a name for the meta-document information. Different programs that access meta-document information expect different values for this attribute
Example 1: indexing information
In this example, the META tag stores indexing information that a search engine uses when it accesses the document. This search engine expects the NAME attribute to have a value of "keywords" when a document is indexed. Search utilities and some webcrawlers used by web search servers will catalog this information. The index keywords are stored as the value of the CONTENT attribute.
<HEAD> <TITLE>HTML Reference</TITLE> <META NAME="keywords" CONTENT="HTML documentation reference Netscape"> </HEAD>
This document is indexed under the terms "HTML", "documentation", "reference", and "Netscape".
Example 2: a special HTTP header
In this example, the META tag creates a special HTTP header field called "Creation_Date". This field is returned by the server when an HTTP connection for this document is established.
<HEAD> <META NAME="Creation_Date" CONTENT="July 17, 1995 19:24:00"> </HEAD>
This example creates the following HTTP header field:
Creation_Date: July 17, 1995 19:24:00
In this example, the META tag creates a special HTTP header field that implements a client pull animation. The animation shows three different views of a dog; these views, when loaded sequentially, simulate the dog running. The CONTENT attribute specifies that each view of the dog is displayed for three seconds.
When a user loads spot1.html, the file is displayed for three seconds. Then the second file, spot2.html is loaded. After three more seconds elapse, spot3.html is loaded by the browser. The following code is contained in a file called spot1.html:
<HEAD> <TITLE>See Spot Run</TITLE> <META NAME="refresh" CONTENT="3,URL='http://www.homepage.com/spot2.html'"> </HEAD> <BODY> <IMG SRC="spot1.gif"> </BODY>
The file spot2.html contains the following information:
<HEAD> <TITLE>See Spot Run</TITLE> <META NAME="refresh" CONTENT="3;URL='http://www.homepage.com/spot3.html'"> </HEAD> <BODY> <IMG SRC="spot2.gif"> </BODY>
Similarly, the file spot3.html contains a reference to spot3.gif within an IMG tag.
Tag reference list Part 3Go to Tag reference section, Part 3
Navigator 3.0
The MULTICOL tag establishes an area of the document as having multiple, equal-width columns.
<MULTICOL
COLS="number" required
GUTTER="gwidth"
WIDTH="colwidth"
>
...
</MULTICOL>
COLS="number" specifies the number of text columns for the text display. Netscape Navigator attempts to flow elements evenly across the columns to make each column be about the same height. Unless the WIDTH attribute is present, column width is adjusted to fill the available view.
GUTTER="gwidth" specifies the number of pixels to appear between columns. If it is not specified, Netscape Navigator uses 10.
WIDTH="colwidth" specifies the width of each column in the group, in pixels. All columns are the same width. If WIDTH is not present, its value is determined by subtracting from the display width the number of pixels that constitute the gutter and then dividing by the number of columns
The following example uses the MULTICOL tag to display three columns of text.
<MULTICOL COLS="3" WIDTH="520" > <P> HyperText Markup Language (HTML) is a set of tags and attributes that mark how text is organized and displayed by web browsers. </P><P> HTML documents are files containing text and tags written for the HyperText Transport Protocol (HTTP)--the protocol used throughout the World Wide Web. </P><P> HTML tags define both the structure of a web page and the way the marked text displays in a browser such as Netscape Navigator. Tags mark the start and the end of text. For example, you can use the H1 tag to mark text as a first-level heading. When a web browser such as Netscape Navigator displays that text, it appears in a large font, </P><P> HTML documents may have different appearances on different browsers. Even if all of your readers use Netscape Navigator, they all might not see your HTML page in the same way because they can configure Netscape Navigator to use different fonts and to override your color settings. </P> </MULTICOL>
_IMG SRC="tags3a.gif" HEIGHT=292 WIDTH=396>
Navigator 1.1
The NOBR tag ensures that a line of text does not wrap to the next line. This tag is useful for words or phrases that must be kept together on one line. However, note that if the line of text is long, it can extend beyond the margin of the browser window, so the user must use scrollbars to view the text.
The following example uses the NOBR tag to display a long line of text.
<NOBR> Line breaks are not inserted into the text contained within a <NOBR> block. This tag should be used with care, since it can create <i>really</i> long lines of text. </NOBR>
_IMG SRC="tags3a1.gif" HEIGHT=74 WIDTH=589>
Use the NOEMBED tag if your document might be displayed on a browser that cannot display content from plug-in programs, and you want to provide alternative content. Browsers that can display objects ignore all text in the NOEMBED tag.
The following example uses the NOEMBED tag to provide alternate information for a browser that cannot embed objects.
<NOEMBED> Sorry -- this page requires a web browser that can display objects. We recommend <I>Netscape Navigator</i>. </NOEMBED> <EMBED SRC="MyMovie.mov", WIDTH="150"> <EMBED SRC="Game.ids", WIDTH="400">
Use the NOFRAMES tag to provide alternative content for browsers to display if they do not recognize frames. Browsers that can display frames ignore all text in the NOFRAMES tags unless a file called by a frame tag is missing or unreachable by the browser.
Place the NOFRAMES tag within the FRAMESET tag.
The following example uses the NOFRAMES tag within the FRAMESET tag.
<FRAMESET ROWS="50%,*"> <FRAME SRC="upper.html"> <FRAME SRC="lower.html"> <NOFRAMES> Sorry -- this page requires a web browser that supports frames. We recommend <I>Netscape Navigator</i>. </NOFRAMES> </FRAMESET>
Navigator 3.0
The NOSCRIPT tag delimits the content for a browser to display when JavaScript is not available, or when the user has turned off support for JavaScript by means of the Network|Languages preferences setting.
The OL tag creates an ordered, or numbered, list. The default numbering style is determined by the browser, but you can use the tag's attributes to change the numbering sequence. Use LI to designate the individual list items.
<OL
START="value"
TYPE="value"
>
...
</OL>
START="value" indicates the starting number for the list. The number must be a positive integer.Navigator 1.1
TYPE="value" defines the type of numbering sequence used for each list item, depending on the type of list the item is in. Navigator 1.1 The value can be:
The following example uses the LI tag to define three list elements in an ordered list. The numbers are roman numerals and begin with the number three.
The following steps outline how to create HTML files:
<OL START="3" TYPE="I"> <LI> Use a text editor or Netscape Navigator Gold to create your HTML file. <LI> Put the HTML files on a web server. <LI> Test the files by accessing them with the server's URL. </OL>
_IMG SRC="tags3a2.gif" HEIGHT=160 WIDTH=378>
The OPTION tag specifies a single option within the scope of a SELECT tag.
<OPTION
VALUE="optionValue"
SELECTED
>
...
</OPTION>
VALUE="OptionValue" specifies a value that is returned to the server when the option is selected and the form is submitted. When no VALUE attribute is present, the value returned is the same as the text following the <OPTION> tag.
SELECTED specifies that the option is selected by default.
The following example uses OPTION to specify the selections in a SELECT list. The user can select only one item from this list. The value returned to the server is "Standard", "2-day", or "speedy".
<FORM> ... <B>Shipping method:</B><BR> <SELECT> <OPTION> Standard <OPTION SELECTED> 2-day <OPTION VALUE="speedy"> Overnight </SELECT> ... </FORM>
_IMG SRC="tags3a3.gif" HEIGHT=136 WIDTH=378>
The P tag specifies a paragraph. You must use the P tag to separate content because in HTML carriage returns aren't significant. The P tag puts space after the paragraph (unlike the BR tag). Most browsers do not recognize the ending tag.
<P
ALIGN="LEFT"|"CENTER"|"RIGHT"
>
...
</P>
ALIGN specifies the horizontal alignment of the paragraph. Navigator 1.1 The value can be:
The following example uses the P tag to break the text into two paragraphs.
<P > The <P> tag begins
a new paragraph.
<P> The </P> tag can terminate a paragraph, but few
web browsers require it. As a result, few authors user it.
_IMG SRC="tags3a4.gif" HEIGHT=122 WIDTH=377>
The PARAM tag assigns a value for a parameter required by an applet.
<PARAM
NAME="value" required
VALUE="value" required
>
NAME="value" specifies the name of the variable.
VALUE="value" specifies the value for the variable.
The following example uses the PARAM tag to assign values to variables required by the applet.
<APPLET CODEBASE="http://www.netscape.com/comprod/products/navigator/version_2.0/java_applets/StarField"
CODE="stars.class" WIDTH="400" HEIGHT="100">
<PARAM NAME="numstars" VALUE="50">
</APPLET>
Deprecated in favor of PRE.
The PLAINTEXT tag displays text in a plain text style, with no additional styles (bold, italics, underlined). The PLAINTEXT tag suppresses interpretation of all HTML tags within its scope.
The following example uses the PLAINTEXT tag.
<PLAINTEXT> The <B>PLAINTEXT</B> tag suppresses interpretation of HTML tags that <I>follow</I> it to the end of the document.
The PRE tag displays preformatted text in the fixed-width font as determined by the font setting (Options|General Preferences). Using this tag you can insert and reproduce formatted text, preserving its original layout, but you have to use entities for the <> and other symbols. The <PRE> tag suspends text joining and blank suppression. This makes the <PRE> tag useful for duplicating blocks of text that were created for some text-only form, such as electronic mail messages and news postings.
The PRE tag does not suppress interpretation of other HTML tags, unlike XMP and PLAINTEXT.
The mail message said: <PRE> To: Lee Smith From: Chris Brown Subject: Meeting schedule Date: Fri, 13 Sep 1996 22:00:05 9/17/96 8:00 a.m. Room 218 9/18/96 9:00 a.m. Room 218 9/23/96 2:00 p.m. Room 111 </PRE>
Navigator 3.0
See "STRIKE (strikeout type)" on page 143. The <S> ... </S> pair is exactly equivalent to the <STRIKE> ... </STRIKE> pair.
The SAMP tag delimits a sequence of literal characters, such as example text. The text is rendered in the fixed-width font, as determined in Options|General Preferences. It is equivalent to the XMP tag.
When writing HTML documents, be sure to start with a basic HTML document layout: <SAMP> <HTML> <HEAD> </HEAD> <BODY> </BODY> <</HTML> </SAMP>
The SCRIPT tag specifies client-side JavaScript code. Anything that you enter within the SCRIPT tag is treated as a script element by the browser. For example, text within angle brackets is interpreted by the browser as a script element, not as an HTML element.
See the JavaScript Guide for more information.
<SCRIPT
LANGUAGE="LanguageName" required
unless SRC is present
SRC="Location"
>
...
</SCRIPT>
LANGUAGE="LanguageName" specifies the program language. If the LANGUAGE attribute is not specified, the default value is JavaScript.
You can specify JavaScript 1.1 for scripts to be executed by the 1.1 version of JavaScript (compatible with Navigator 3.0), or JavaScript 1.0 for scripts to be executed by the 1.0 version. Navigator 3.0
SRC="Location" specifies the URL of the script, if you want to load a script from a separate file. The suffix on a Location specifies the scripting language. The web server maps the suffix to the MIME time, so a script that contains JavaScript code should have a suffix that maps to "appliation/x-javascript" Navigator 3.0
Example 1: using the SCRIPT tag
The following example uses the SCRIPT tag to define a JavaScript script. Because the SCRIPT tag is contained within the HEAD tag, the script is loaded before anything else in the document is loaded. The JavaScript code in this example defines a function which opens another browser window.
<SCRIPT LANGUAGE="JavaScript"> function createWindow() { answerWindow=window.open(answerWindowUrl) } </SCRIPT>
Example 2: using the SRC attribute
The following example uses the SRC attribute to specify the location of a file containing JavaScript code:
<SCRIPT LANGUAGE="JavaScript" SRC="http://www.netscape.com/myScript.js"> </SCRIPT>
The SELECT tag defines a selection list on an HTML form. A selection list lets the user choose one or more items from a list.
When a form is submitted to the server, the value portion of a selection list's name=value pair is the text that follows the selected OPTION tag.
<SELECT
NAME="selectName" required
MULTIPLE
ONBLUR="blurJScode"
ONCHANGE="changeJScode"
ONCLICK="JScode"
ONFOCUS="focusJScode"
SIZE="ListLength"
>
...
</SELECT>
MULTIPLE specifies that multiple items can be selected. If omitted, only one item can be selected from the list.
NAME="selectName" specifies the name of the select element. This value is the name portion of the name-value pair sent to the server when the form is submitted. The name is not displayed on the form.
ONBLUR="blurJScode" specifies JavaScript code to execute when the select element loses focus. See the JavaScript Guide for information on event handlers.
ONCHANGE="changeJScode" specifies JavaScript code to execute when the select element loses focus and its value has been modified. See the JavaScript for information on event handlers.
ONCLICK="JScode" specifies JavaScript code to execute when a user clicks the button. See the JavaScript Guide for information on event handlers.
ONFOCUS="focusJScode" specifies JavaScript code to execute when a user clicks the select element or tabs to it. See the JavaScript Guide for information on event handlers.
SIZE="ListLength" specifies the number of options visible when the form is displayed. If the list contains more options than specified by size, the list is displayed with scrollbars.
The following example creates a list. The user can select only one item from this list.
<FORM> ... <B>Shipping method:</B><BR> <SELECT> <OPTION> Standard <OPTION SELECTED> 2-day <OPTION> Overnight </SELECT> ... </FORM>
_IMG SRC="tags3a5.gif" HEIGHT=136 WIDTH=376>
If the SIZE attribute is omitted as shown here, the list is displayed as a pull-down list, as shown in the Shipping Method list in the previous figure. If SIZE is present, the list looks similar to the Music Types list in the previous figure.
The following example creates a list. The MULTIPLE attribute lets the user select multiple items from this list.
<FORM> ... <B>Music types for your free CDs:</B><BR> <SELECT NAME="music_type_multi" MULTIPLE> <OPTION> R&B <OPTION> Jazz <OPTION> Blues <OPTION> Reggae </SELECT> ... </FORM>
_IMG SRC="tags3a6.gif" HEIGHT=139 WIDTH=378>
Example 3: multiple selection with default
In the following example, all three options can be chosen, but bananas are selected by default.
<FORM> ... <SELECT NAME="fruit_choices" MULTIPLE> <OPTION>Apples <OPTION SELECTED>Bananas <OPTION>Cherries </SELECT> ... </FORM>
_IMG SRC="tags3a7.gif" HEIGHT=136 WIDTH=378>
The SERVER tag specifies server-side JavaScript statements that are compiled by LiveWire. (Contrast this with the SCRIPT tag, which specifies client-side JavaScript statements.) When a script is specified within the SERVER tag, LiveWire runs it on the server. See the LiveWire Developer's Guide for more information about JavaScript in LiveWire.
The following example uses the SERVER tag to define a LiveWire script. This LiveWire script connects to a database server:
<SERVER> database.connect("INFORMIX", "blue", "ADMIN", "MANAGER", "mydb") </SERVER>
Navigator 2.0
The SMALL tag displays text in a smaller font size than the default font size. The text displays one size smaller (n-1). You can specify the default font size using the BASEFONT tag. Unless defined by the user, the default font size is 3.
The following example decreases the font size two times for "smaller, and smaller."
<FONT SIZE="+1"> When Alice ate from the Caterpillar's mushroom, she grew <SMALL>smaller and <SMALL>smaller.</SMALL></SMALL> </FONT>
_IMG SRC="tags3a8.gif" HEIGHT=90 WIDTH=377>
Navigator 3.0
The SPACER tag provides better control over the spacing of objects and whitespace in HTML pages. It governs the space between words or between lines, or creates a spacing rectangle, similar to an invisible image.
<SPACER
ALIGN="LEFT"|"RIGHT"|"TOP"|"ABSMIDDLE"|"ABSBOTTOM"|
"TEXTTOP"|"MIDDLE"|"BASELINE"|"BOTTOM"
HEIGHT="value"
SIZE="value"
TYPE="HORIZONTAL"|"VERTICAL"|"BLOCK"
WIDTH="value"
>
ALIGN applies only when the spacer is of type BLOCK, and specifies the alignment of the spacing rectangle in relation to the surrounding text. If you do not specify a value for ALIGN, Navigator uses "BOTTOM" as the default.
HEIGHT="value" applies only when the spacer is of type BLOCK, and specifies the height of the spacing rectangle in pixels.
SIZE="pixelSize" depents on the value of TYPE. When the spacer is of type BLOCK, pixelSize specifies the absolute width or height in pixels of the spacing rectangle. When the spacer is of type HORIZONTAL or VERTICAL pixelSize specifies the absolute width or height in pixels of the added space.
TYPE specifies whether the spacing is that between words, that between lines, or that of a rectangular space.
WIDTH="value" applies only when the spacer is of type BLOCK, and specifies the width of the spacing rectangle in pixels.
Navigator 3.0
The STRIKE tag displays text with a line (strike) through it.
The following example displays "strikes" with a line through the word.
Three <STRIKE>strikes</STRIKE> and you're out.
_IMG SRC="tags3a9.gif" HEIGHT=100 WIDTH=431>
The STRONG tag defines text that displays with "strong emphasis." Typically the text is displayed in boldface.
<STRONG>CAUTION!</STRONG> If you aren't careful, you may hurt yourself.
_IMG SRC="tags3a10.gif" HEIGHT=83 WIDTH=380>
Navigator 2.0
The SUB tag displays text as a subscript. A subscript appears slightly below the baseline (bottom edge) of preceding text and in a smaller font.
The following displays a subscript.
The chemical notation for water is <CODE>H<SUB>2</SUB>0</CODE>.
_IMG SRC="tags3a11.gif" HEIGHT=91 WIDTH=378>
Navigator 2.0
The SUP tag displays text as a superscript. A superscript appears slightly above preceeding text and in a smaller font.
The following example displays the 2 in e=mc2 as a superscript.
If Einstein was right, then <CODE>e=mc<SUP>2</SUP></CODE>.
_IMG SRC="tags3a12.gif" HEIGHT=93 WIDTH=378>
Navigator 1.1
The TABLE tag defines a table. Rows are defined by the <TR> tag and cells within the rows by the <TD> tag.
<TABLE
ALIGN="LEFT"|"RIGHT"
BGCOLOR="color"
BORDER="value"
CELLPADDING="value"
CELLSPACING="value"
HEIGHT="height"
HSPACE="pixHoriz"
WIDTH="pixels"|"value%"
VSPACE="pixVert"
>
...
</TABLE>
ALIGN specifies the horizontal placement of the table:
If you want to center a table, you can use the DIV tag with ALIGN="CENTER" around the table.
BGCOLOR="color" changes the color of the background for the table. This color can be overridden by a BGCOLOR tag in the TH, TR, or TD tags. The value of color is a hexadecimal red-green-blue triplet, or a color name. See Appendix B, "Color values."Navigator 3.0
BORDER="value" draws a border around the table. The value is the number of borders (lines) you want around the table. Use a value of 0 to use the space reserved for borders to expand the area of your table.
CELLPADDING="value" determines the amount of space between the border of a cell and the contents of the cell. The default is 1.
CELLSPACING="value" determines the amount of space between individual cells in a table. The default is 2.
HEIGHT="height" specifies the height in pixels that the table must fit. The table is scaled to fit the specified height and width.
HSPACE="pixHoriz" specifies the horizontal space in pixels within which the table must fit. The table is scaled to fit the specified height and width
VSPACE="pixVert" specifies the vertical space in pixels within which the table must fit. The table is scaled to fit the specified height and width.
WIDTH="pixels"|"value%" defines the width of the table. The default is the optimal width determined by the contents of each cell. The measurement value can be a number of pixels or the width as a percentage of the page size.
The following example creates a three-column, four-row table, with the caption "Tables are as easy as on