tito11 tito11 - 1 month ago 8
HTML Question

How to make html ignore code that is part of text?

I need to include some codes in my html document

I've tried

<pre>
tag, but that didn't help.

How do I get this code into a document like text?

Thanks

Answer

Short Answer.

Encode your code using an online HTML Encoder and then put it inside pre

<pre>
    <%--your encoded code goes here--%>
</pre>

Long Answer.

The above will only help you to show your code. If you want proper highlighting for your code, Try something like SyntaxHighlighter

Link: How to use SyntaxHighlighter.