The
w3schools<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.
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:
- W3schools. (no date) HTML <samp> tag. Available at: https://www.w3schools.com/TAGs/tag_samp.asp (Accessed: 5 October 2022).