<code>
The code element represents a fragment of computer code in a monospace font.
Syntax
<code>...</code> Examples
<p>Run <code>npm install</code> to add dependencies.</p>
Output
Renders "npm install" inline in a monospace font.
Notes
Inline by default; wrap in <pre> to preserve whitespace for multi-line blocks. Escape <, >, and & inside code content.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |