Menu
Text & Formatting

<code>, <pre>, <kbd>, <samp>, <var>

Display code, keyboard input, output samples, and variables.

1Code-Related Tags

<code> is inline computer code. <pre> preserves whitespace (perfect for code blocks). <kbd> is keyboard input. <samp> is sample output. <var> is a variable.

Example Code
<p>Use the <code>map()</code> method.</p>

<pre><code>function hello() {
  console.log('hi');
}</code></pre>

<p>Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.</p>
<p>Output: <samp>404 Not Found</samp></p>
<p>Solve for <var>x</var>.</p>

Finished reading?

Mark this topic as complete to track progress.