How to print code on HTML
You need to use character references instead of the plain characters themselves:
<code><HTML></code>
The elements code
and pre
are just to mark the content as code or preformated.
The <xmp>
tag doesn't require the contents to be escaped.
eg:
<xmp>
<p>Blah </p>
</xmp>
...will look like this on your screen:
<p>Blah </p>
By escaping them.&
will print &
<
will print >
You didn't mention what you're using to generate the html, if you're manually editing, some editors have options to escape a selection. If you're using a language, look for some function that escapes html special characters. (google for how to escape html in language-name-here
)