Easy Tutorial
❮ Canvas Textbaseline Att Input Readonly ❯

HTML <samp> Tag

Example

Formatting text in a document:


Browser Support

All major browsers support the <samp> tag.


Tag Definition and Usage

The <samp> tag is a phrase tag used to define sample output from a computer program.

Tip: We do not oppose the use of this tag, but if you are using it just for visual effects, we recommend using CSS, which might achieve more丰富的 effects.

All phrase tags:

Tag Description
<em> Renders as emphasized text.
<strong> Defines important text.
<dfn> Defines a definition term.
<code> Defines a piece of computer code.
<samp> Defines sample output from a computer program.
<kbd> Defines keyboard input. It indicates text that should be entered by the user. It is often used in documents or manuals related to computers.
<var> Defines a variable. You can use this tag with <pre> and <code> tags.

Differences Between HTML 4.01 and HTML5

None.


Global Attributes

The <samp> tag supports HTML's global attributes.


Event Attributes

The <samp> tag supports HTML's event attributes.


Related Articles

HTML Tutorial: HTML Text Formatting

❮ Canvas Textbaseline Att Input Readonly ❯