Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Special Characters

Most fonts now include special characters for European languages, such as the accented é in Café. There are also a few mathematical symbols and special punctuation marks such as the circular • bullet.

You can insert these special characters at any point in an HTML document by looking up the appropriate codes in Table 6.2 or in the complete list of character entities in Appendix D, "HTML Character Entities." You'll find an even more extensive list of codes for multiple character sets online at http://www.w3.org/tr/rec-html40/sgml/entities.html .

For example, the word Café would look like this:

café

Each symbol also has a mnemonic name that might be easier to remember than the number. Here is another way to write Café:

café

Notice that there are also codes for the angle brackets, quotation, and ampersand in Table 6.2. You need to use the codes if you want these symbols to appear on your pages; otherwise, the Web browser interprets them as HTML commands.

Table 6.2. Important English-Language Special Characters

Character Numeric Code Code Name Description
" " " Quotation mark
& & & Ampersand
< &#60; &lt; Less than
> &#62; &gt; Greater than
¢ &#162; &cent; Cent sign
£ &#163; &pound; Pound sterling
| &#166; &brvbar; or brkbar; Broken vertical bar
§ &#167; &sect; Section sign
© &#169; &copy; Copyright
® &#174; &reg; Registered trademark
° &#176; &deg; Degree sign
± &#177; &plusmn; Plus or minus
2 &#178; &sup2; Superscript two
3 &#179; &sup3; Superscript three
· &#183; &middot; Middle dot
1 &#185; &sup1; Superscript one
¼ &#188; &frac14; Fraction one-fourth
½ &#189; &frac12; Fraction one-half
¾ &#190; &frac34; Fraction three-fourths
Æ &#198; &AElig; Capital AE ligature
æ &#230; &aelig; Small ae ligature
É &#201; &Eacute; Accented capital E
é &#233; &eacute; Accented small e
x &#215;   Multiply sign
÷ &#247;   Division sign

In Figures 6.6 and 6.7, several more of the symbols from Table 6.2 and Appendix D are shown in use.

06fig06.gif

Figure 6.6 Special character codes begin with & and end with ;.

06fig07.jpg

Figure 6.7 This is how the HTML page in Figure 6.6 will look in most, but not all, Web browsers.

Share ThisShare This

Informit Network