πŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
πŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

HTML <samp> Tag

Mark sample output from a program or system. Learn samp tag and sample output semantics.

samp.html
<p>The output was
<samp>Hello, world!</samp>
.</p>
πŸ–₯️
samp.html
1 / 7
πŸ–₯️

Tutor:The <samp> tag represents sample output from a program or system. Browsers typically render it in a monospace font. Use it for terminal output, computer messages, or example output in documentation.


Samp Mastery

Unlock nodes by learning the samp tag and sample output semantics.

Concept 1: The Samp Tag

The <samp> tag marks sample output from a program or system. Browsers often render it in monospace. Use it for terminal output, program messages, or example output in docs.

System Check

Which element marks sample output from a program?


Community Holo-Net

Share Sample Output Patterns

Using <samp> in docs or tutorials? Share your patterns.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

HTML <samp> Tag

Author

Pascual Vila

Frontend Instructor.

The <samp> tag represents sample output from a program or system. Browsers typically render it in a monospace font. Use it for terminal output, computer messages, or example output in documentationβ€”not for code snippets (use <code> for that).

samp vs code

<samp> = sample output (what a program prints). <code> = code snippet (what to type or copy). Use <samp> when you are showing the result of running something; use <code> when you are showing the command or code itself.

Best practices

Pair <kbd> for keyboard input with <samp> for output in tutorials. Use <samp> for semantic sample output so assistive tech can distinguish output from code and input.

Samp Tag Glossary

<samp>
HTML element for sample output from a program or system. Often rendered in monospace. Use for terminal output, program messages, or example output in docs.
<code>
Element for code snippets (to type or copy). Use <samp> for output; use <code> for the code or command itself.
<kbd>
Element for keyboard input. Often paired with <samp> in tutorials: Type <kbd>run</kbd>. You see <samp>Done.</samp>