To use Highlight.js with automatic language detection, link the library and a style sheet, then call hljs.initHighlightingOnLoad(). This method automatically finds and highlights code blocks contained within <pre><code> tags.
If you want to manually specify a language instead of relying on automatic detection, add a class to the <code> element using the language name, or prefix it with language- or lang- (e.g., class="html" or class="language-html").
To prevent a specific block from being highlighted, use the no-highlight class.
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- Manual language specification -->
<pre><code class="html">...</code></pre>
<!-- Disable highlighting for a specific block -->
<pre><code class="no-highlight">...</code></pre>