O'Reilly logo

Web Design in a Nutshell, 2nd Edition by Jennifer Niederst Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Character Entity References

Characters not found in the normal alphanumeric character set, such as < and &, must be specified in HTML using character entities. Using the standard desktop publishing keyboard commands (such as Option-g for the © symbol) within an HTML document will not produce the desired character when the document is rendered in a browser. In fact, the browser generally displays the numeric entity for the character.

Character entities can be referenced by name (& name ;) or by numeric value (&# nnn ;). The browser interprets the string to display the proper character. Named entities are preferable because numeric values may be interpreted differently on different platforms.

Table 10-3 presents the character entities for commonly used special characters. The complete list appears in Appendix F.

Table 10-3. Common special characters and their character entities

Character

Description

Name

Number

Character space (nonbreaking space)

&nbsp;

&#160;

&

Ampersand

&amp;

&#038;

<

Less-than sign (useful for displaying tags on a web page)

&lt;

&#060;

>

Greater-than sign (useful for displaying tags on a web page)

&gt;

&#062;

"

Left curly quotes (nonstandard entity)

(none)

&#147;

"

Right curly quotes (nonstandard entity)

(none)

&#148;

Trademark (nonstandard entity)

(none)

&#153;

£

Pound symbol

&pound;

&#163;

¥

Yen symbol

&yen;

&#165;

©

Copyright symbol

&copy;

&#169;

®

Registered trademark ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required