What is the <samp> element in HTML?

In HTML, the <samp> element is used to enclose in-line text representing sample output from a computer program.

The contents of the <samp> element are typically rendered using the browser’s default monospaced font.

Syntax

<samp> output content </samp>

Code

The following code demonstrates the usage of the <samp> element in HTML. The content that we want to display as the sample output of a program is written within the opening and closing tags, <samp> and </samp>.

  • HTML

Free Resources