Wants To Buy This Template?? Contact Us Buy Now!

Create Beautiful Code Frames Widgets With Highlight Js


Hello Blogger user guys, if you have my blog, you can see that my code sharing frame has many beautiful colors, right? Now I will share with you how to create.

In this article, we will use the source code Highlight.js

what is Highlight.js

Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup doesn't depend on any framework and has automatic language detection.

Perform

Find the closing </body> tag and insert the following code:
	<link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css' rel='stylesheet'/>
<script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
  $('pre').each(function(i, block) {
    hljs.highlightBlock(block);
  });
});
//]]>
</script>
If your theme does not have jquery yet, please add this paragraph
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
</script>
Then save and enjoy the results.
If you use Jagodesain's interface like Median UI, Fletro Pro, then you go to the CSS line
.post pre span{color:var(--highlight-green)} .post pre span.block{color:#fff;background:var(--highlight-blue)}

Instructions for Use

If the type you share is HTML then use this code
<pre class='html'><code>
	Your_code_here
</code></pre>
If it's CSS then use this code
<pre class='css'><code>
	Your_code_here
</code></pre>
And Javascript uses this code
<pre class='js'><code>
	Your_code_here
</code></pre>

About the Author

Student | Blogger | Youtuber

2 comments

  1. I love this post from tamilnadu bro ☺
    1. Plz join our telegram group more post like this
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.