HTML <samp> etikett

Definition och användning

<samp> Etiketten används för att definiera ett exempel på utdata från ett datorprogram. Innehållet inom etiketten visas med webbläsarens standardbreddsteg.

Tips:Denna etikett har inte övergivits. Men, mer rika effekter kan uppnås genom att använda CSS.

See also:

标签 Description
<code> Define example output of a computer program.
<kbd> Define keyboard input.
<var> Define variables.
<pre> Define preformatted text.

See also:

HTML tutorial:HTML text formatting

HTML DOM reference manual:Samp object

Example

Define some text as an example output of a computer program in the document:

<p>Message from my computer:</p>
<p><samp>File not found.<br>Press F1 to continue</samp></p>

Try it yourself

Global attributes

<samp> The tag also supports Global attributes in HTML.

event attributes

<samp> The tag also supports Event attributes in HTML.

Default CSS settings

Most browsers will display the following default values <samp> Element:

samp {
  font-family: monospace;
}

Try it yourself

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support