Marking Up Code
There are also two HTML tags specifically used for marking up code:
<code> is displayed in a monospace font and is used to represent a short snippet of computer code.
<pre> is also displayed in a monospace font and represents preformatted text. That means any text, including white spaces, appears exactly as it was typed.
If you need to display multiple lines of code, place the <code> element inside a <pre> element. The only time you should use <code> by itself is for an inline element (CODE 4.2, FIGURE 4.7).
FIGURE 4.7 Code 4.2 as rendered in Chrome.