CODE

Description

This element is used to specify a code sample. By default, the font used is a small fixed-width.

Syntax

<CODE
CLASS=Style Sheet class name
ID=value
LANG=language
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
STYLE=styling
TITLE=text content
event = script
>

Parameter

Description

CLASS

Class of the tag being defined. This is used to associate a subclassed style sheet with the tag.

ID

SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underscore character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.

LANG

Specifies which language to use in ISO standard language abbreviation form.

LANGUAGE

Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT.
* JAVASCRIPT, JSCRIPT The script is written in JScript.
* VBS, VBSCRIPT The script is written in VBScript.

STYLE

Inline style sheet for the tag.

TITLE

The TITLE attribute is for advisory information (unless used with a mailto: attribute). The Title attribute should provide the title of the document whose address is given by the HREF attribute. The contents of the title attribute will be displayed in a tooltip during the mouse moves on the link. Internet Explorer 4.0 (and above) is the only browser to implement this.

event

Can be one or more of these events:
onclick ;
ondblclick ;
ondragstart ;
onhelp ;
onkeydown ;
onkeypress ;
onkeyup ;
onmousedown ;
onmousemove ;
onmouseout ;
onmouseover ;
onmouseup ;
onselectstart

 

Version

The Internet Explorer 4.0 (and above) specific TITLE attribute is used for informational purposes.

The LANGUAGE attribute can be used to expressly specify which scripting language Internet Explorer 4.0 uses to interpret any scripting information used in the <CODE> element.

Example

<CODE>The text is in a small, fixed-width font.</CODE>

It will be rendered as:

The text is in a small, fixed-width font.

Remarks

If a font face is specified with the FONT or BASEFONT elements preceding CODE, that font is used instead.

This element is a block element. Both the start and end tags are required.

Related Topics

SAMP, FONT, BASEFONT