Add Syntax Highlighting in your Blogger Website
Hello, Guys Welcome to Shiva Technic World. In this post, I am going to give you the Syntax Highlighting code for Blogger. So let's check.
What is Syntax Highlighting | highlight.js
Syntax Highlighting is a feature that gives you the facility to Highlight codes over 196 languages on your website with the help of highlight.js.
Benefits of using Syntax Highlighting
1. This Syntax Highlighting was responsive
2. Gives colours to your highlighted codes
3. Gives a professional and simple look
4. Highlight codes fastly
How to add Syntax Highlighting to your Blogger website?
First copy this code then paste above </head> or <!--<head/>--></head>
<link href='https://cdn.jsdelivr.net/npm/highlight.js@11.3.1/styles/agate.css' rel='stylesheet'/>
Then paste this code above </body> or <!--</body>--></body>
<script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js'/>
<script>hljs.initHighlightingOnLoad();</script>
Usage
Use this code for displaying code in your post
<pre><code>your_code_here</code></pre>
Add your code on your_code_here text.
If auto-highlighting code not worked
<pre><code class="language-html">your_code_here</code></pre>
Use this code for displaying code in your post. For example, there gave html change it with your language and Add your code on your_code_here text.
Last words
Hope this post will help. If you have any doubts related to this post ask me in the comment and check more in Toorzo Thanks for reading!
2 comments