Horje

Full Example Code for syntax highlighter code

Follow the Example
index.html
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>

Output should be:

Full Example Code for syntax highlighter code



Single Articles
Full Example Code for syntax highlighter codeHTML Syntax Highlighter Tutorial
How to print HTML code with colors syntax highlighting on a HTML pageHTML Syntax Highlighter Tutorial


Related Articles
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