<samp> Tag in HTML | Sample Output
The <samp> tag in HTML is used to represent sample output from a computer program or script. It is often used in technical documentation or tutorials where the output of a code is displayed. Text inside the <samp> tag is typically styled with a monospaced font to resemble code output.
Key Points on <samp> Tag:
- The <samp> tag is used to display the result of a computer program or script.
- Text within the <samp> tag is rendered in a monospaced font, which is often used to represent output or code snippets.
- The <samp> tag is useful for documentation and tutorials where the output of a command or program needs to be shown.
- The content inside the <samp> tag is not interactive and is used strictly for display purposes.
Syntax of <samp> Tag:
Syntax Example
<samp>Your sample output here</samp>
Example of <samp> Tag in HTML:
This example demonstrates how to use the <samp>
tag to display the output of a program.
Code Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML <samp> Tag Example</title>
</head>
<body>
<h1>Sample Program Output</h1>
<p>
The following is the output of the program:
</p>
<samp>Process completed successfully</samp>
</body>
</html>
Output
Sample Program Output
following is the output of the program:
Process completed successfully
The <samp>
tag is useful for displaying sample output in HTML documents. By styling text in a monospaced font, it clearly distinguishes program output or other types of non-interactive results from regular text. This tag helps in creating technical content and tutorials where it's important to show what the output of a program might look like.