HTML Samp Tag

In HTML, the <samp> tag stands for sample tag.

  • It is used to enclose inline text which represents a sample or output of a computer program.

  • Also, it is a phrase tag.

  • The content inside the starting and ending of <samp> tag is typically rendered in the browser's default monospaced font.

  • The <samp> tag comes under the category of Inline elements.

HTML <samp> Tag Syntax and Usage

The <samp> tag requires the start(opening) tag and end(closing) tag. Given below is the basic syntax for the <samp> tag:

..content here

HTML <samp> Tag Basic Example

Below we have a basic example to show the usage of <samp> tag:

HTML <samp> Tag Attributes

This tag does not have specific attributes; though it supports global and event attributes.

Default CSS Settings for HTML <samp> Tag

Given below are the default CSS settings used by most of the browsers:-

samp {
  font-family: monospace;

Browser Support for HTML <samp> Tag

Following browsers support this attribute:

  • Google Chrome 6.0+

  • Internet Explorer 9.0+

  • Firefox 4+

  • Opera 11.1+

  • Safari 5.0+