To use Highlight.js on a web page, include the library and a CSS theme, then call hljs.initHighlightingOnLoad(). The library will automatically find and highlight code inside <pre><code> tags by attempting to auto-detect the language.
To explicitly specify a language when auto-detection fails, use the class attribute on the <code> tag with the language name (e.g., class="html") or use the language- or lang- prefixes.
To disable highlighting for a specific block, use the nohighlight class.
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- Explicit language specification -->
<pre><code class="html">...</code></pre>
<!-- Disable highlighting -->
<pre><code class="nohighlight">...</code></pre>