Summary
The HTML <samp> element is an inline 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).
Usage context
Content categories | Flow content, phrasing content |
Permitted content | Phrasing content |
Tag omission | None, must have both a start tag and an end tag. |
Permitted parent elements | Any element that accepts phrasing content. |
Normative document | HTML5, section 4.6.13; HTML 4.01, section 9.2.1 |
Attributes
This element only includes the global attributes.
DOM Interface
This element implements the HTMLElement
interface.
Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.
Example
<p>Regular text. <samp>This is sample text.</samp> Regular text.</p>
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
- HTML Code Element
- HTML 4.01 Specification: Phrase Elements
{{ languages({ "ja": "ja/HTML/Element/samp", "pl": "pl/HTML/Element/samp"}) }}
{{ HTMLRef }}