The <code> tag

<code> marks a short fragment of computer code within text — a function name, a variable, a command.

Syntax

<code>functionName()</code>

Example

<p>Call <code>fetch()</code> to request the data.</p>

Notes

  • For multi-line code blocks, pair code with pre: <pre><code>...</code></pre>.
  • Browsers render code in a monospace font by default; this can be overridden with CSS.

Related tools