HTML <samp> tag
The <samp> tag is used to define an output from a computer program. The text within this element will display in the monospace font-family.
Type: Inline Element
Syntax of <samp> tag
<samp> Program output </samp>
Supported Browsers
| Tag | Chrome | Internet Explorer | Firefox | Safari | Opera Mini |
|---|---|---|---|---|---|
| <samp> | Yes | Yes | Yes | Yes | Yes |
Full code example
<!DOCTYPE html> <html> <head> </head> <body> <!--Right Form--> <p> Wrong output comes with <samp>Error!</samp>. </p> <!--Wrong Form--> <p> Wrong output comes with Error!. </p> </body> </html>
Wrong output comes with Error!.
Wrong output comes with Error!.
Difference between <kbd>, <code> and <samp> tag
| Tag | Note |
|---|---|
| <kbd> | It defines user input. |
| <code> | It defines computer code. |
| <samp> | It shows program output. |
<samp> tag is a phrase tag. A phrase tag means a tag having semantical structure and meaning rather than just its apppearance.
Default CSS property of <samp> tag
samp { font-family: monospace; }
