HTML code

From Htmlpedia
Jump to: navigation, search

HTML Element CODE

Definition and Usage

The <code> tag is similar to the <pre> tag, only <code> is intended to be designated a fragment of computer code where as <pre> is designated to hold preformatted text, hence the name. Also, <code> only takes the width of the text within it and doesn't span the whole 100% whereas <pre>'s takes the full 100% unless told otherwise through the use of the width style property.


Examples

<p>The function <code>COS (X)</code> calculate and return the Cosine of the parameter X.</p>

Attributes

Optional attributes

None

Standard Attributes

id, class, title, style, dir, lang

Event Attributes

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


Tags in Tag

  • Fontstyle

TT, I, B, BIG, SMALL

  • Phrase

EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM


References


Back to HTML Elements