HTML <samp> Tag

This HTML <samp> Tag is used to define sample output from a computer program. The content inside appears in the browser’s default monospace font.

HTML <samp> Tag is a phrase tag used to represent sample output from a computer program or script in a browser.

Text between <samp> and </samp> appears in the browser’s default monospace font.

Note:- The <samp> Tag is not yet deprecated, but you can also use the CSS property to get the same result.

Example:-

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        HTML samp Tag
    </title>
</head>
<body>

<h1>This is HTML samp Tag Example</h1>
<p>Press <samp>Ctrl</samp> + <samp>C</samp> to copy text (Windows).</p>

<p>Press <samp>Cmd</samp> + <samp>C</samp> to copy text (Mac OS).</p>
</body>
</html>

Output:-

Tip: This tag is not disliked. However, it is possible to achieve a rich effect using CSS (see example below).

HTML <code> Tag

HTML <samp> Tag

HTML <var> Tag

HTML <pre> Tag

HTML <kbd> Tag


Related Posts

3 thoughts on “HTML Samp Tag

Leave a Reply

Your email address will not be published. Required fields are marked *