samp (HTML element)

Spec
Depr. Empty Version
No No HTML 2
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

<samp>
</samp>

Description

The samp element’s purpose is to identify a sample of characters that form the output or result of some process. It’s not often seen in practice, but would most probably be encountered in an online technical manual or support site of some kind.

The example code would render as shown in Figure 1.

Figure 1. Browser output of samp element Example of samp element

Example

In this example, a support site provides an explanation of a 404 error:

<p>If the browser spits out an error message such as
    <samp>HTTP 404 - File not found</samp>,
    you may simply have typed the address incorrectly.</p>

Another usage that you may come across is to indicate choices from computer menu items (e.g. in a browser or application):

<p>The <samp>File</samp> menu is where you will find the important 
<samp>Load</samp> and <samp>Save</samp> commands</p>

Use This For …

This element is used to mark up a sequence of characters or a phrase that forms the output of some kind of machine or computer process.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

The samp has good browser support: most of the major browsers render it in a fixed-width font.

User-contributed notes

Related Products