Working with Special CharactersMost fonts now include special characters for European languages, such as the accented é in Café• bullet. Table 5.2. You'll find an even more extensive list of codes for multiple character sets online at http://www.webstandards.org/learn/reference/named_entities.html.
For example, the word café would look like this: café HTML/XHTML uses a special code known as a character entity© and ®. Character entities are always specified starting with a & and ending with a ;. Table 5.2 lists the most commonly used character entities, although HTML supports many more. café: café Notice that there are also codes for the angle brackets, quotation, and ampersand in Table 5.2 In Listing 5.7 and Figure 5.8, several of the symbols from Table 5.2 are shown in use. Listing 5.7. Special Character Codes<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Punctuation Lines</title>
</head>
<body>
<p>
Q: What should you do when a British banker picks a fight with you?<br />
A: £ some ¢¢ into him.
<hr />
Q: What do you call it when a judge takes part of a law off the
books?<br />
A: § violence.
<hr />
Q: What did the football coach get from the locker room vending machine
in the middle of the game?<br />
A: A ¼ back at ½ time.
<hr />
Q: How hot did it get when the police detective interrogated the
mathematician?<br />
A: x³°
<hr />
Q: What does a punctilious plagiarist do?<br />
A: ©
<hr />
</p>
</body>
</html>
Figure 5.8. This is how the HTML page in Listing 5.7 will look in most web browsers.![]() |
| |||||||||||||||||||