Saturday, November 19, 2011

Geek Stuff: XHTML Character Entities

So you wish to display HTML codes in blog posts so that they will not be interpreted as codes and trigger an action by the browser. You will need to display the code wrappers such as the lesser than (<) and greater than (>) signs as text, and use their character entities instead. The most common ones I use are:

" is written as &quot;
& is written as &amp;
< is written as &lt;
> is written as &gt;

Also if you want to use hearts in your posts:

is written as &#2764;
is written as &#2661;
is written as &#2665;

LinkWithin

Related Posts Plugin for WordPress, Blogger...