Example:
HTML
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/[email protected]/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/[email protected]/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>
<pre><code class="language-html">
<xmp>
<canvas id="myCanvas">
Your browser does not support the canvas tag.
</canvas>
<script>
let canvas = document.getElementById("myCanvas");
let ctx = canvas.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0, 0, 80, 80);
</script>
</xmp>
</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 |