This is an important message requiring you to make a choice if you're based in the EU.

HTML <samp> Tag

The <samp> tag contains sample output from a computer program or a script. In the browser, the content of the tag is by default displayed in monospace font.


The <samp> tag comes in pairs; its content is written between the opening (<samp>) and the closing (</samp>) tags.


<!DOCTYPE html>
    <title>Title of the document</title>
    <p>You see an ordinary text here. <samp>But this is a sample text.</samp> And another ordinary text.</p>


In HTML, there are other elements used to define parts of a technical document: the <code> tag is used for defining the computer program output; the <kbd> tag is used for specifying a keyboard input; and the <var> tag is used for specifying variables.


The <samp> tag supports the Global attributes and the Event Attributes.

Browser support

Do you find this helpful?

Related articles