I'd recommend using highlightjs as it supports a large number of languages and comes with many color themes. For HTML code specifically, you need to escape HTML tags. There're many tools online to help you in achieving that.
Here's a quick demo for that using highlighjs:
Example:
HTML
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/darkula.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<pre><code class="hljs html">
<ul>
<li ng-repeat="list in lists" class="input">
{{list}}
</li>
</ul>
</code></pre>
Full Example Code for syntax highlighter code | HTML Syntax Highlighter Tutorial |
How to print HTML code with colors syntax highlighting on a HTML page | HTML Syntax Highlighter Tutorial |
How to syntax highlighter code for html css xml style | HTML Syntax Highlighter Tutorial |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Syntax Highlighter Tutorial |
Uploaded by: | Admin |