HTML <samp> Tag
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the <samp> tag.
Tag Definition and Usage Instructions
The <samp> tag is a phrase tag used to define sample text from a computer program.
Tip:We do not oppose using this tag, but if you use it only for visual effects, we suggest using CSS, which may achieve richer effects.
All phrase tags:
| Tag | Description |
|---|---|
| <em> | Renders as emphasized text. |
| <strong> | Defines important text. |
| <dfn> | Defines a definition term. |
| <code> | Defines computer code text. |
| <samp> | Defines sample text. |
| <kbd> | Defines keyboard text. It indicates text entered from the keyboard. It is often used in computer-related documents or manuals. |
| <var> | Defines a variable. You can use this tag together with the <pre> and <code> tags. |
Differences between HTML 4.01 and HTML5
None.
Global Attributes
The <samp> tag supportsHTML Global Attributes。
Event Attributes
The <samp> tag supportsHTML Event Attributes。
Related Articles
HTML Tutorial:HTML Text Formatting
Other Extensions