HTML Encyclopaedia

The samp tag

The HTML element
<samp> text </samp>

Is used for "sample" output from programs etc. The meaning is unclear from the HTML standards and the tag is rarely used. It seems to render text (in a monopitch typeface) as entered but line layout is not honoured. HTML special characters have to be escaped.

Here is an example

1==1 1<=2 1>=0

Here is the HTML for the example above

<samp>
1==1
1&lt;=2
1&gt;=0
</samp>
Notice that this is not the same as pre-formatted text.

It can also be used within running text thus: a sample of text.

Browsers
ARA, NN3, IE3 and OP2 render text within a <samp> in a mono-pitch type-face similar to that used for <pre>, MOS3 is similar but uses a much larger type-face.


See also <code>, <dfn>, <kbd>, <var> and <cite>

Note On many browsers this tag and the others mentioned immediately above, all have exactly the same effect. Differences are purely historical.