HTML Tag Reference - HTML tag <samp>

This <samp> element displays text in a monospaced or fixed-width font. It is typically used to display code samples.

Browser compatibility

<samp> Yes Yes Yes Yes Yes

What's new in HTML5


Global Attributes

The <samp> tag supports the Global Attributes in HTML.

Event Attributes

The <samp> tag supports the Event Attributes in HTML.

Default CSS Settings

samp { 
    font-family: monospace;


A demo showing how to use <samp> tag.

          You can apply the
          attribute to nearly any element.

Click to view the demo