HTML Tag Reference - HTML tag <code>








<code> causes text to be displayed in a monospaced font and is usually applied to code samples.

Browser compatibility

<code> Yes Yes Yes Yes Yes

What's new in HTML5

None.

Global Attributes

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

Event Attributes

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

Default CSS Settings

code {
    font-family: monospace;
}




Example

A demo showing how to use <code> tag.

<html>
<body>
     <p>
          This is a
          <code>code</code>
          .
     </p>
</body>
</html>

Click to view the demo