Computer Code | WebReference

Computer Code

HTML 4.01 Element Reference

By Lee Underwood

Return to HTML 4.01 element index page

Name: Computer Code

<code> ... </code>

Description: Indicates the enclosed text is source code from a programming language. Usually rendered in a monospace font.

Browser Compatibility: NN: 1.0+ / IE: 2.0+ / Opera: 4+

Attributes:
  • class
  • dir
  • id
  • lang
  • onclick
  • ondblclick
  • onkeydown
  • onkeypress
  • onkeyup
  • onmousedown
  • onmousemove
  • onmouseout
  • onmouseover
  • onmouseup
  • style
  • title

Code Example:

<code>function myFunction()</code>

Comments: Best used with small fragments of code as it does not preserve the layout of the code.




Created: March 15, 2005

URL: http://webreference.com/html/reference/specs/