Navigation Aids

 
 
 
 
 
Tutorials

Sidebar

Main Content

Coding Character Entities

There are 2 ways of coding each character:
a numeric code and a named entity.
Here's the chart:
Description Character Numeric Code Browser Support Named Entity Browser Support
IE6 N7 N4 IE6 N7 N4
quotation mark " " yes yes yes " yes yes yes
apostrophe* ' ' yes yes yes do not use no yes yes
ampersand & & yes yes yes & yes yes yes
less than < &#60; yes yes yes &lt; yes yes yes
greater than > &#62; yes yes yes &gt; yes yes yes
nonbreaking space   &#160; yes yes yes &nbsp; yes yes yes
*   Although &apos; is widely cited as the correct coding for an apostrophe, we do not recommend it. &apos; is not supported by IE6.
And here's how to construct your code:
Named Entity
Start * Code End
& name ;
Numeric Code
Start * Code End
&# number ;
*   Named entities start with & only, but numeric code starts with & and #.
In general, the numeric code progresses in arithmetic sequence but there are 2 gaps:
These numeric codes are not supported:
*from &#0; through &#31
*from &#127; through &#159
*