Datasheet
22
Part I: Getting to Know (X)HTML and CSS
Entities
Text makes the Web possible, but it has limitations. Entities are special char-
acters that you can display on your Web page.
Non-ASCII characters
Basic American Standard Code for Information Interchange (ASCII) text
defines a fairly small number of characters. It doesn’t include some special
characters, such as trademark symbols, fractions, and accented characters.
For example, if we translate a paragraph of text from the page in Figure 1-2
into German, the result includes three u characters with umlauts (ü), as
shown in Figure 1-4.
Figure 1-4: ASCII text can’t represent all text characters, so HTML
entities do the job instead.
ASCII text doesn’t include an umlauted u, so HTML uses entities to represent
such characters. The browser replaces the entity with the character it refer-
ences. Each entity begins with an ampersand (&) and ends with a semicolon
(;); entities come originally from SGML, so we color-code them in purple to
reflect their origins. The following markup shows entities in bold:
<html>
<head>
<style type=”text/css”>
body {
font-family: sans-serif;
font-size: large;
}
cite {
font-family: serif;
font-style: italic;
}
06_9780470916599-ch01.indd 2206_9780470916599-ch01.indd 22 11/30/10 12:23 AM11/30/10 12:23 AM