Beginner's Guide to XHTML
Wednesday 22nd June 2005 - Saturday 7th January 2006
Categories: Guides, Internet, Code
Special Characters
When writing in XHTML, there are various characters that are not in the normal character set. There are also characters that are using in writing XHTML, and so cannot be displayed as you would a normal character. For these characters, you must use a character entity. The table below shows some of the special characters you may use. Of particular note is the ampersand. You must use the character code for it not only in normal text, but when defining a link.
Character code | Result |
---|---|
" or " |
" |
& or & |
& |
< or < |
< |
> or > |
> |
or   |
Non breaking space |
¡ or ¡ |
¡ |
¢ or ¢ |
¢ |
£ or £ |
£ |
¤ or ¤ |
¤ |
¥ or ¥ |
¥ |
¦ or ¦ |
¦ |
§ or § |
§ |
© or © |
© |
® or ® |
® |
± or ± |
± |
² or ² |
² |
³ or ³ |
³ |
¼ or ¼ |
¼ |
½ or ½ |
½ |
¾ or ¾ |
¾ |
× or × |
× |
÷ or ÷ |
÷ |
For a fuller list of characters, you can look at the reference on the World Wide Web Consortium's Website. Here is an example of how to use the table:
<!ENTITY uml CDATA "¨" -- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
The part after ENTITY tells you the first way you can write the character, in this case ¨
. The part after CDATA tells you the second way you can write the charater, in this case ¨
. The final part is a description of the character.