W3cubDocs

/HTML

<samp>

The HTML <samp> element is an element intended to identify sample output from a computer program. It is usually displayed in the browser's default monotype font (such as Lucida Console).

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Permitted ARIA roles Any
DOM interface HTMLElement

Attributes

This element only includes the global attributes.

Example

<p>Regular text. <samp>This is sample text.</samp>
  Regular text.</p>

Result

Regular text. This is sample text. Regular text.

Specifications

Specification Status Comment
WHATWG HTML Living Standard
The definition of '<samp>' in that specification.
Living Standard
HTML5
The definition of '<samp>' in that specification.
Recommendation
HTML 4.01 Specification
The definition of '<samp>' in that specification.
Recommendation

Note

A CSS rule can be defined for the samp selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.

See also

© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp