
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
Features
- Wide browser support: IE9+, Firefox, Chrome, Safari, Opera, most Mobile browsers
- Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside HTML)
- Highlight specific lines and/or line ranges
Using Prism.js
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”.