HTML <code> tag

The <code> tag is used to display computer code text.

Standard attributes

class, dir, id, lang, style, title, xml:lang

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress, onkeyup

For more information on event attributes, check out our HTML event attributes reference page.

Example

Here is some regular text <code>Here is some computer code text</code> What was that Javascript code again? <code>document.write("Hello " + name + "!");</code>
Output:
Here is some regular text Here is some computer code text What was that Javascript code again? document.write("Hello " + name + "!")
Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com