Special Characters
You might find that you sometimes need to use symbols on your Web pages. Symbols (such as +, –, %, and &) are used frequently in our everyday writing, so it's easy to understand that they would appear on a Web page as well. Unfortunately, not all Web browsers display these symbols correctly. HTML uses a little computer shorthand, either using a numerical code or a text code (called an entity character reference) to tell the browser how to interpret these symbols. Table 3.1 shows some of the most frequently used codes.
Table 3.1. Special Character Codes
Char |
Code |
Description |
& |
& |
Ampersand |
< |
< |
Less than |
> |
> |
Greater than |
© |
© |
Copyright |
® |
® |
Registered trademark |
± |
&plusmin; |
Plus or minus |
2 |
² |
Superscript 2 |
3 |
³ |
Superscript 3 |
´ |
´ |
Acute accent |
` |
` |
Grave accent |
# |
# |
Number |
% |
% |
Percent |
Appendix C, "Special Characters," contains a more complete list of the characters supported by HTML. You can see how many of these symbols are easy to understand (for example, & for the ampersand and > for the greater than symbol). Some of the characters, such as number and percent, require that you memorize numbered codes. Yuck. The best thing you can do is to make sure that you preview your Web pages in a variety of browsers before publishing them.