Signup/Sign In
PUBLISHED ON: FEBRUARY 20, 2021

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:

<samp>
..content here
</samp>

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+



About the author:
Aspiring Software developer working as a content writer. I like computer related subjects like Computer Networks, Operating system, CAO, Database, and I am also learning Python.