The <samp> tag is used to define sample output from a computer program. The content inside is displayed in the browser’s default monospace font. You could naturally add additional formatting using CSS.

w3schools

I am using this (perhaps incorrectly) anywhere I might need to indicate that text is being output, regardless of by what or to what.

<p>The following message appeared on the screen: <samp>Come to the Dark Side, we have cookies</samp>.</p>

produces

The following message appeared on the screen: Come to the Dark Side, we have cookies.

If, for instance, I was looking for an old-school DOS-prompt coding look, I might use some CSS and go for something like this:

<p>The following message appeared on the screen: <samp style="background-color: black; color: white;">Come to the Dark Side, we have cookies</samp>.</p>

produces

The following message appeared on the screen: Come to the Dark Side, we have cookies.


References:

  1. W3schools. (no date) HTML <samp> tag. Available at: https://www.w3schools.com/TAGs/tag_samp.asp (Accessed: 5 October 2022).

By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.