<samp>
InlineRepresents sample output from a computer program. Rendered in monospace to visually distinguish from regular text.
Example
<p>The terminal showed: <samp>404 Not Found</samp></p>
About the <samp> Element
The <samp> HTML element belongs to the Inline category of HTML elements. Represents sample output from a computer program. Rendered in monospace to visually distinguish from regular text. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.
The <samp> element requires both an opening <samp> and closing </samp> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.
Proper use of semantic HTML elements like <samp> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.