Prism is a lightweight, extensible syntax highlighter. Prism is used on several websites. It supports almost all languages.
Download prism.js from the website Download
- Wide browser support: IE9+, Firefox, Chrome, Safari, Opera, most Mobile browsers
- Highlight specific lines and/or line ranges
First we need to include the prism.css and prism.js files downloaded in our web page.
Prism.js works only with <code> elements, since marking up code without a <code> element is semantically invalid.
To highlight HTML code use <pre><code> in the following way. We need to replace all < with <
To highlight css specify class=”language-css”.