Tuesday, May 11, 2010

Techniques to display HTML tags in posts and comments in Blog

Some bloggers may want to post HTML tags in their posts but don't know how. If you want to see below html code in your post

<h1 >My First Heading </h1>

The less than(< )have to be replaced by " & lt;" and the great than( > )have to be replaced by "& gt;" See the below example

& lt; h1 & gt; My First Heading & lt;/h1 & gt;

If you have a large block of HTML code to display, an easy way is to type or copy-paste them into Notepad, then click EDIT > REPLACE.... in the menu bar.

There we can provide an option to replace "< "with "& lt;" By Clicking "Replace all" and all the "<" will be replaced by "& lt;" . You can repeat the process for ">"

Once that is done, you can highlight all the changed code, copy-paste into the comment box or the post editor window and submit your comment or publish your post.

No comments:

Post a Comment