TAG:  code

<code> ... </code>
 
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 &lt; for the < and a &gt; for the >.
 
Usually, the display font appearance for the code, kbd, samp, and tt tags is the same for a specific browser.
 
The pre tag is more commonly used to display code.
 
The separate closing tag is mandatory.
 
Attributes and Events
 
class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML code Tag Example</title>
</head>
<body>
<code>
if (document.getElementById) blnDOM = true;<br />
else if (document.layers) blnNN4 = true;<br />
else if (document.all) blnIE4 = true;<br />
</code>
</body>
</html>

 
Output:
if (document.getElementById) blnDOM = true;
else if (document.layers) blnNN4 = true;
else if (document.all) blnIE4 = true;


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information