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>
</>

If we want to write code.

It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Tag Uses

Specific uses of <samp> tag

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

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.
Try</>

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

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?