<code> ... </code>
Available in versions: 2.0, 3.2, 4.0
The <code> tag is designed to display computer code in a special font,
usually in a mono spaced font style.
However, the exact appearance will be browser dependent.
You may still need to use various HTML tags, such as br and p, to
create a presentation and appearance to suit your needs.
An HTML code example cannot use the HTML delimiters < and >, because they will
be executed by the browser as real HTML code.
Rather you must substitute a < for the < and a > for the >.
Usually, the display font appearance for the code, kbd, samp,
and tt tags is the same.
The listing tag has been deprecated.
The pre tag is more commonly used to display code.
The closing tag is mandatory.
Core Attributes
class
dir
id
lang
onclick
ondblclick
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
style
title
Attributes
None.
Code:
<code>
if (document.getElementById) blnDOM = true;<br>
else if (document.layers) blnNN4 = true;<br>
else if (document.all) blnIE4 = true;<br>
</code>
Output:
if (document.getElementById) blnDOM = true;
else if (document.layers) blnNN4 = true;
else if (document.all) blnIE4 = true;
Copyright 2000 by Infinite Software
Solutions, Inc.
Trademark Information
|