May 5, 2012

Published on with

[HTML formatting, HTML code formatting for website, keep original HTML format, preserve HTML code, tips on HTML format for blogs, guide on HTML code]

What The! Where Are My HTML Codes Gone

Yeah. That was my expression when I saw that my "raw" HTML code in a blog post has been converted to an icon which I did not want to. And it's not only one code, there were several of them in one post. And the worse part was, not only that post was affected but there were some more posts. So I was thinking, reading, searching and scratching a lot till I found an easiest solution.

For example, I wanted to show people, the code behind the twitter follow button by pasting the code directly in the body of the post. When I viewed it, the code has been changed to the follow icon which I did not want to show.

Intended Reader for This Post

This post is intended for those people who are beginner to blogging as well as do not have previous or very good knowledge of HTML language to provide easiest way to preserve HTML codes in their blog or website. If you want to show original HTML code to your reader, but do not know how to do it and do not want to go through a lot of complexity, then this post is for you.

All those who already knew how to do HTML code preserving, please skip this post or if you like, please refer this post.

Easiest Method to Preserve Original HTML Code

Simply replace the " < " signs with " &lt; " (red character with blue characters, excluding " " sign).

An Example to Demonstrate How It Works

Let's say, the original code is:

<div style="color: red; text-align: center;">
<u><i><b>Demonstrate how to preserve HTML code&t;/b></i></u></div>

Now, if you do not replace " < " sign with " &lt; ", then in your post this will transform as:

Demonstrate how to preserve HTML code

But if you do, you will preserve the code as shown as original.

Congratulation! You Have Preserved Original HTML Code

Isn't it very easy! But for sure there are multiple of ways to do this as usual. I'll be glad to know about the other method you may have used.

If you like this post or if this post is informative for you, feel free to share and "Like".


Post a Comment