HTML<samp>tag

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

The content written between the <samp> and </samp>, tags renders in a browser?s default monospace font.

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

Syntax

<samp>Write sample output here.....</samp>  

Following are some specifications about the HTML <samp> tag

DisplayInline
Start tag/End tagBoth Start and End tag
Usagetextual

Example

<!DOCTYPE html>  

<html>  

<head>  

    <title>HTML samp tag</title>  

    <style>  

     body{  

        text-align: center;  

              }  

    </style>  

</head>  

<body>   

<h2>Example of samp tag</h2>  

<p>I am trying to install a software on my system but it is continuously giving an error message:  

</p>  

<p><samp>Error 5: Access is denied.</samp></p>  

</body>  

</html>

Output:

HTML samp tag

Attribute:

Tag-specific attributes:

The <samp> tag does not contain any specific attribute.

Global attribute:

The <samp> tag supports the global attributes in HTML

Event attribute:

The <samp> tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<samp>YesYesYesYesYes

Comments

Leave a Reply

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