<CODE> | NN all IE all HTML all |
<CODE>...</CODE> | HTML End Tag: Required |
The code element is one of a large group of elements that the HTML 4 recommendation calls phrase elements. Such elements assign structural meaning to a designated portion of the document. A code element is one that is used predominantly to display one or more inline characters representing computer code (program statements, variable names, keywords, and the like). Browsers have free rein to determine how (or whether) to distinguish code element content from the rest of the body element. Both Navigator and Internet Explorer elect to render code element content in a monospace font, usually in a slightly smaller font size than the default body font (although it is not reduced in IE 4 for the Macintosh). Override the default with a style sheet as you see fit. Whitespace (including carriage returns) is treated the same way in code element content as it is in the browser's body element content. Line breaks must be manually inserted with br elements. See also the pre element for displaying preformatted text that observes all whitespace entered in the source code. |
|
Example | |
<P>Initialize a variable in JavaScript with the <CODE>var</CODE> keyword.</P> |
|
Object Model Reference | |
[window.]document.getElementById(elementID)
|
|
Element-Specific Attributes | |
None. |
|
Element-Specific Event Handler Attributes | |
None. |
lang | NN 3 IE 4 HTML 4 |
lang="languageCode" | Optional |
The language being used for the element's attribute values and content. A browser can use this information to assist in proper rendering of content with respect to details such as treatment of ligatures (when supported by a particular font or required by a written language), quotation marks, and hyphenation. Other applications and search engines might use this information to aid the selection of spell-checking dictionaries and the creation of indices. |
|
Example | |
<SPAN lang="de">Deutsche Bundesbahn</SPAN> |
|
Value | |
Case-insensitive language code. |
|
Default | |
Browser default. |
|
Object Model Reference | |
[window.]document.getElementById(elementID).lang
|