samp: The Sample Output element
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.
Attributes
Global attributes
accesskey
Specifies a keyboard shortcut to activate or focus an element.
aria-*
Defines accessibility properties and states for assistive technologies.
class
Specifies one or more CSS class names for styling the element.
data-*
Stores custom data private to the page or application.
dir
Sets the text direction (left-to-right, right-to-left, or auto).
hidden
Hides the element from display and assistive technologies.
id
Defines a unique identifier for the element within the document.
inputmode
Hints which virtual keyboard type to display on mobile devices.
itemid
Provides a global identifier for microdata items.
itemprop
Defines a property name-value pair for microdata.
itemref
Associates properties with an item via element IDs for microdata.
itemscope
Creates a new microdata item container.
itemtype
Specifies the vocabulary URL for microdata items (like Schema.org).
lang
Specifies the primary language of the element’s content.
nonce
Provides a cryptographic nonce for Content Security Policy.
role
Defines the element’s semantic role for accessibility.
tabindex
Controls keyboard navigation order and focusability.
title
Provides advisory information displayed as a tooltip.
Example
<p>After running your static site generator, you should see:</p>
<p><samp>Site built successfully! 15 pages generated in 0.3 seconds.</samp></p>
<p>When you check your domain's DNS settings, the output might look like:</p>
<p><samp>example.com. 300 IN A 192.0.2.1</samp></p>
<p>Testing your website's accessibility with a screen reader might announce:</p>
<p><samp>Heading level 1: Welcome to My Personal Website</samp></p>
<p>Your web server logs will show successful requests like:</p>
<p><samp>GET /index.html HTTP/1.1" 200 1234</samp></p>