O'Reilly logo

Beginning Web Programming with HTML, XHTML, and CSS, Second Edition by Jon Duckett

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

Appendix F. Special Characters

Some characters are reserved in XHTML; for example, you cannot use the greater-than and less-than signs or angle brackets within your text because the browser could mistake them for markup. XHTML processors must support the five special characters listed in the table that follows.

Symbol

Description

Entity Name

Number Code

&

Ampersand

&

&

<

Less than

&lt;

&#60;

>

Greater than

&gt;

&#62;

"

Double quote

&quot;

&#34;

 

Non-breaking space

&nbsp;

&#160;

To write an element and attribute into your page so that the code is shown to the user rather than being processed by the browser (for example, as <div id="character">), you would write:

&lt;div id=&quot;character&quot;&gt;

There is also a long list of special characters that HTML 4.0–aware processors should support. In order for these to appear in your document, you can use either the numerical code or the entity name. For example, to insert a copyright symbol you can use either of the following:

&copy; 2008
&#169; 2008

The special characters have been split into the following sections:

  • Character Entity References for ISO 8859-1 Characters

  • Character Entity References for Symbols, Mathematical Symbols, and Greek Letters

  • Character Entity References for Markup-Significant and Internationalization Characters

They are taken from the W3C Web site at www.w3.org/TR/REC-html40/sgml/entities.html.

Character Entity References for ISO 8859-1 Characters

Entity Name

Symbol

Number Code

Description

&nbsp;

 

&#160;

No-break space = non-breaking space

&iexcl; ...

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