Html has several tag pairs tags for this purpose:
code, kbd, pre, samp, tt, var
code is an inline pair of tags used to show computer code
kbd i an inline pairs used to represent keyboard input.
<kbd>C:> diskcopy a: b:</kbd>
pre is for preformatted text. It is a block version of code
<pre>
for i=1 to 10
print i, a[i]
next i
</pre>
They render everything between them exactly as written, including indenting. It renders as:
for i=1 to 10
print i, a[i]
next i
samp is inline for printer output
<samp>
Account Total
0001245 $ 12.45
0001365 $ 67.21
0002435 $ 0.00
</samp>
tt is for teletype in a monospace font
var is inline for a variable
All of these are in the xhtml standard as well as the html.
samp shows printer output.