HTML <samp> Tag


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.


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


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



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.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th September 2023