HTML samp tag

<samp> tag presents the simple text in the form of computer coding style. It is commonly used with <kbd> tag.


<p>If we want to write code.</p>
<samp> It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </samp>	
Try </>

samp element may also be used with kbd element.


<p>To copy the file into external hard drive press <samp> <kbd>Ctrl</kbd> + <kbd>c</kbd> </samp> to copy. 
 Then press <samp> <kbd>Ctrl</kbd>+<kbd>v</kbd></samp> to paste the file.	


In the above example, kbd is used with samp to write commands.

Specific uses

The common use of samp element is to print computer program.

Tag omission

Both opening and closing tags are necessary for the samp element.

Global Attributes

All the global attributes are applicable on the samp element.

Was this article helpful?




Get the newsletter