samp (HTML element)
| Depr. | Empty | Version |
|---|---|---|
| No | No | HTML 2 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ |
|---|---|---|---|
| Full | Full | Full | Full |
Syntax
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.
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>
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 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.0 | 9.2 | 9.5 |
| 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
- ID:
- #1
- Date:
- Fri, 28 Mar 2008 10:48:06 GMT
In help texts or instructions I think it's appropriate to use SAMP to mark up things like menu items. For instance,
<p>The <samp>File</samp> menu contains...</p>
This can then be styled with CSS, e.g.,
samp {font:menu}
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.