<samp>
The <samp> HTML element is used to enclose inline text which represents sample (or quoted) output from a computer program. Its contents are typically rendered using the browser's default monospaced font (such as Courier or Lucida Console).
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | ≤4 | 18 | ≤3.2 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
HTML
<p>Console output: <samp>Hello, World!</samp></p>
<p>Error:<samp> File not found</samp></p> Live demo
Use cases
-
Using <samp>
The <samp> HTML element is used to enclose inline text which represents sample (or quoted) output from a computer program.
Cautions
- May not be supported in older browsers.
Accessibility
- Verify how this element is announced by screen readers.