Knowledge Base Articles » KB100211: Using HTML Character Entities to Prevent Tags from Being Interpreted by the Browser.

If you have ever tried to display HTML code on a web page you will have come across the problem of the browser interpreting your tags as opposed to displaying them.

For example, lets say we want to show how to create a link from your web page to another. If we just type the following in our HTML source, we will not see the tags displayed:

HTML source:

Use the <a></a> tags to create a link to another page.

Browser output:
 
Use the tags to create a link to another page.

The answer is to use the specific character entity when writing your source. A full list of the available characters and their entities can be found here. They are all preceded by an ampersand, '&', and followed by a semi-colon, ';'. The character entity for the 'less than' symbol, for example, is written thus:

&lt;

and the entity for 'greater than' looks like this:

&gt;

Therefore, if we want to write our original line so that the browser displays it correctly, without interpreting the tags, we should write it in our source as follows:

Use the &lt;a&gt;&lt;/a&gt; tags to create a link to another page.