Displaying HTML And Javascript In Blogger Blog Posts

If you have tried to display HTML or Javascript or any other code in Blogger posts, then you must have seen that the code isn't displayed in the Blog Post. Check the following example below:

If you want to display how to add image to blog post I will put the following code in the Blog Post

<img src="Image URL Here" alt="image" />

But when you check the post, instead of the code you will see only image as seen below as the we have kept alt="image" . Rest of the code wont be visible.


However the method to display HTML/Javascript/CSS or any other code in the Blog Posts is very easy and you don't even have to add any code to the blog template. Just go to the Adsense Code Converter and paste your code and click on Convert.

Now that you have converted the code, go to the blog post and paste the converted code and publish the post. Now the code will be visible in the blog post.

Now that you have displayed the HTML/CSS/javascript code in the blog post, its better if you highlight the code so that everyone can differentiate it from the normal post. You can use Bold to highlight it but it doesn't look good. So after you have converted the code, paste it between the following two tags

Paste the Code Here

So now the code will appear like shown below

<img src="Image URL Here" alt="image" />

That's it. I hope that you found this post useful. If you are facing any problem then use the comments section below.