HTML <samp> Tag

Description

The <samp> HTML tag is used to enclose text that represents sample output or code within a document. It is often used in documentation or tutorials to display examples of what a program or script might produce. When the <samp> tag is applied to text, it typically renders the enclosed content in a monospace font, making it visually distinct from the regular text and indicating that it represents a piece of code or sample output. This helps readers easily identify and differentiate between code snippets and regular text in web documents.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

You will see <samp>END PROGRAM</samp> after 
it stops scrolling.
If it never stops, send the <samp>STOP</samp>
command to the program.

Attributes

None

Global Attributes

The <samp> tag also supports the Global Attributes in HTML5

Event Attributes

The <samp> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <samp> tag.

Desktop
Edge Chrome Firefox Opera Safari
1211154
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
184143.214.4

Last updated by CSSPortal on: 30th September 2023