Tuesday, March 3, 2009

CODE tag

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 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

No comments:

Post a Comment