Tag <code> HTML Reference



Example

Format text in a document:

<code>A piece of computer code</code>

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

1. Definition and Usage

The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, <var>, and <cite> tags are all phrase tags. They are not deprecated, but it is possible to achieve them with CSS.

Tag Description
<code> Defines a piece of computer code

2. Differences Between HTML 4.01 and HTML5

None


3. Standard Attributes

The <code> tag supports the Standard Attributes in HTML.


4. Event Attributes

The <code> tag also supports the Standard Event Attributes in HTML.


Relative articles