Thursday, September 17, 2009

How To Write Tags In Your Blog

When you do your blogging sometimes you need to put HTML tags in your posts. Simple ways of typing it manually and copy pasting will not work because browser will interpret your tags along with its mark ups of < and > as real tags, so therefore they will not be shown in monitors or just simply vanished.

For example, if you want to show to your readers on ‘How to make bold letters using HTML codes’ then you start demonstrating it by putting the HTML tags or codes in your posts (see below).

<b>Having fun with HTML codes</b>

After we have written down all the characters in our posts and published them, people will not see the same characters, but instead:

Having fun with HTML codes

The browser will consider the 'example' tag as a real tag. Therefore, your browser will apply it like any other HTML tags, insttead of showing it to your reader. What we need to do to solve this problem is that we have to make the tags not recognized as tags (by browsers). In order to do that, we need to write the tag mark ups of < and > with entities.

What is entities?, codes which draw certain characters in HTML programming is called entities.

The entity codes for < is &lt; and for > is &gt;

How to write tags on blog
So the proper way of showing it to your reader, you need to write it as (in our post, before publishing it):

&lt;b&gt;Having fun with HTML codes&lt;/b&gt;

No comments:

Post a Comment