Easy Tutorial
❮ Att Img Ismap Att Object Align ❯

HTML <code> Tag

Example

Formatting text in a document:


Browser Support

All major browsers support the <code> tag.


Tag Definition and Usage

The <code> tag is a phrase tag used to define computer code text.

Tip: We do not oppose the use of this tag, but if you are using it just for visual effects, we recommend using CSS, which might achieve richer effects.

All phrase tags:

Tag Description
<em> Renders as emphasized text.
<strong> Defines important text.
<dfn> Defines a definition term.
<code> Defines computer code text.
<samp> Defines sample output text.
<kbd> Defines keyboard input. It indicates text that is typed from the keyboard and is often used in computer-related documents or manuals.
<var> Defines a variable. You can use this tag with <pre> and <code> tags.

Differences Between HTML 4.01 and HTML5

None.


Global Attributes

The <code> tag supports HTML's global attributes.


Event Attributes

The <code> tag supports HTML's event attributes.


Related Articles

HTML Tutorial: HTML Text Formatting

❮ Att Img Ismap Att Object Align ❯