How to add code snippet in you Blogger without any Java Script

Adding Code Snippet in Website or Blogger

Are you looking for adding your code into your website/blogger, then you have come to the right place. After reading this blog you will get the answer for how to add code box in blogger post ?

Few days before I was also searching for adding code into my blog. I searched on Google a lot and found many solutions. Many of them where using Java Scripts. But Java Script will make your website heavier and your site will take more time to load.

In this blog will share very simple example where you can convert source code to html and you can display any programming code on web page without executing it.

There are Two easiest ways of doing it:

<--- 1 --->

You can add the following small code to share code snippet and display code snippet in html:


<pre style="background-color: #eeeeee; 
 border: 1px dashed rgb(153, 153, 153); 
        color: inherit;
        font-family: andale mono, lucida console, monaco, fixed, monospace; 
        font-size: inherit;
        line-height: 14px; 
        overflow: auto; 
        padding: 5px; 
        width: inherit;">
 <code style="color: black; overflow-wrap: normal;">
  <<<<<<YOUR CODE HERE >>>>>>
 </code>
</pre>
                                                      

Replcae "YOUR CODE HERE" with the code you want to print on html page. and paste the resultant code at suitable location in your html code.

For html code replace >  to  &gt; and  <  to  &lt; in your code then pate it at YOUR CODE HERE.

It's Done !!

< -- 2 -->

Using hilite.me (hilite me). 
  1. You have to just paste your code and Choose the language 
  2. click Highlight.
  3. Copy and and use HTML code in your Blog/Website.
  4. It's Done !! 

Comments