Skip to main content

Display Code in Blogger Posts

Suppose you are writing a article which includes HTML code and that code you want to share with rest of the world. But displaying HTML Code on a webpage is not easy because the browser tends to interpret the HTML tags instead of displaying them. It will be simple to understand the reason behind it if we know how does the browser know something is an HTML tag? Browser looks for opening and closing brackets that starts and ends a tag. So those brackets (i.e. < & >) are the key. Now it is obvious that if we change those starting and ending brackets sign with something else, our problem will be solved.


1. Replace < (i.e. less than sign) with &#38lt;

2. Replace > (i.e. greater than sign) with &#38gt; 3. Replace (i.e. quote mark) with &#38quot;


We want to display the code below on our webpage – <a href=>Example Post</a>

We would replace <> sign with &#38lt; and &#38gt; respectively. The result will look like this –

&#38lt;a href=;Example Post&#38lt;/a&#38gt;