Simply using <xmp> or <pre>
tag won't help you display HTML as plain text. The just help to format the text. In order to show HTML to your users you need to escape all special characters.
For example, replace all <
signs with <
and all >
signs with >
.
I've shown just two symbols, a quick google search will help you to find all the symbols and their replacements.
And in case you're using PHP, it has built in function to do this. i.e. htmlentities($str)
. Search for whatever language you are using.
Note that <xmp> Tag has been deprecated.