HTML Tutorial
The <samp> tag is used to represent sample output from a computer program or script. It visually distinguishes sample code or user input from the surrounding text.
The <samp> tag does not support any specific attributes.
<samp>The command line output is: $ ls</samp><samp>Enter your username:</samp><samp>The result of the calculation is: 42</samp>Simple HTML Example:
<!DOCTYPE html>
<html>
<head>
<title>Exploring the <samp> Tag</title>
</head>
<body>
<h1>Sample Output</h1>
<p>Here is an example of the <code><samp></code> tag:</p>
<samp>The command line output is: $ ls</samp>
</body>
</html>
Assistive technologies, such as screen readers, may announce the <samp> tag as "sample output" or "sample code." This helps users understand the nature of the content and distinguish it from regular text.