<samp> elementThe <samp> element represents sample output from a computer program or computing system. It is for text that the machine produced, not for text that the user typed and not simply for code written by the author.
For example, an error message, command-line response, compiler warning, browser console message, or printed result from a program can be marked with <samp>. The element tells the reader that this text is being quoted as output.
This makes it different from <code>. The <code> element marks code itself: instructions, selectors, property names, function names, or fragments of a programming language. The <samp> element marks what came back after something ran.
It also differs from <output>. The <output> element is for a live result produced by a page or form. The <samp> element is usually quoted sample output inside an explanation, lesson, article, or reference page.
The element can be used inline for short messages, or inside <pre> for larger blocks of console output. This preserves line breaks and spacing in the output.
The example below pairs <kbd> for a command the user enters with <samp> for the response. These elements describe the text; they do not run the command or generate its output.
Attributes: GLOBALS.
Typical layout: <pre><kbd>echo Hello</kbd> <samp>Hello</samp></pre>
Visual representation:
echo Hello Hello