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

<

&lt;

Less than

>

&gt;

Greater than

©

&copy;

Copyright

®

&reg;

Registered trademark

±

&plusmin;

Plus or minus

2

&sup2;

Superscript 2

3

&sup3;

Superscript 3

´

&acute;

Acute accent

`

&#96;

Grave accent

#

&#35;

Number

%

&#37;

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, &amp; for the ampersand and &gt; 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.

Tip

Here's a special character that you should remember: &nbsp;. The symbol stands for nonbreaking space and is used to insert a space inside an HTML document. Because HTML ignores extra spaces between words and tags, you'll need to have a way of including extra spaces. You can do that with the &nbsp; character.




Sams Teach Yourself HTML in 10 Minutes
Sams Teach Yourself HTML in 10 Minutes (4th Edition)
ISBN: 067232878X
EAN: 2147483647
Year: 2004
Pages: 151
Authors: Deidre Hayes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net