Define some text as sample output from a computer program in a document:
<p>Message from my computer:</p>
<p><samp>File not found.<br>Press F1 to continue</samp></p>
Try it Yourself »
The <samp>
tag is used to define sample output from a computer program. The content inside is displayed in the browser's default monospace font.
Tip: This tag is not deprecated. However, it is possible to achieve richer effect by using CSS.
Also look at:
Tag | Description |
---|---|
<code> | Defines a piece of computer code |
<kbd> | Defines keyboard input |
<var> | Defines a variable |
<pre> | Defines preformatted text |
Element | |||||
---|---|---|---|---|---|
<samp> | Yes | Yes | Yes | Yes | Yes |
The <samp>
tag also supports the Global Attributes in HTML.
The <samp>
tag also supports the Event Attributes in HTML.
HTML tutorial: HTML Text Formatting
HTML DOM reference: Samp Object
Most browsers will display the <samp>
element with the following default values:
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!