View video tutorial

HTML <samp> Tag

HTML

The <samp> tag is used to display text as sample output for computer program.

HTML <samp> Tag


The <samp> element encloses the text to represents the output as a computer program.

Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<p>I saw a message on my computer</p>
<p><samp>Device not found.<br>Press F1 to continue..</samp></p>
Try it Now »

Click on the "Try it Now" button to see how it works.