HTML Basics
Stanford University Libraries & Academic Information Resources

Special characters

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]

We're nearly done, but Spore still has a few problems. One is that there are some characters that browsers could mistakenly interpret as markup. Whenever a text contains the characters &, <, >, we need to "protect" them by replacing them with something that the software knows to treat differently from ordinary characters. This is done by means of what is known in SGML as an entity reference, a subject covered in more detail later. For now, let's just note that we always need to replace
&, with &amp;,
< with &lt;, and
> with &gt;

There is an ampersand in the Bibliography that fits the bill:

Example

    <p>Nagin, Deborah and Michael McCann.  "Thymol and
    O-Phenyl Phenol: Safe Work Practices."  In
    Ritzenthaler's Archives &amp; Manuscripts: Conservation,
    Appendix B (see below).
    ...
    </p>

which is rendered

Nagin, Deborah and Michael McCann. "Thymol and O-Phenyl Phenol: Safe Work Practices." In Ritzenthaler's Archives & Manuscripts: Conservation, Appendix B (see below). ...

While we're browsing in the bibliography, we notice that there are some accented characters that need to be handled with other entities. In this case there are a number of names with a á in them, and each of these must be replaced with &aacute;. (there is a table of special characters for which character entitities have been defined in HTML.

        <p>Hor&aacute;kov&aacute;, Hana and Frantisek Martinek.
        "Disinfection of Archive Documents by Ionizing Radiation."
        Restaurator, v. 6, no. 3-4 (1984), p. 205-216.</p>

which is rendered

Horáková, Hana and Frantisek Martinek. "Disinfection of Archive Documents by Ionizing Radiation." Restaurator, v. 6, no. 3-4 (1984), p. 205-216.

Unfortunately, it happens that there are a lot of other characters, mainly special symbols, for which HTML hasn't defined entitities. Fortunately, these symbols can still be used by using Numeric character references. In Spore, the degree symbol ° appears in several places. We can replace each of these occurences with &#176; (a complete table of these replacements is available).

Example

    <p>Most molds thrive at warmer temperatures.  When combined
    with high levels of humidity, temperatures of 70 to 75&#176;
    Fahrenheit will cause mold to develop.  Temperatures below
    freezing will not kill mold, but they do make it dormant.
    Few molds will be active at temperatures of less than 50&#176;
    Fahrenheit.  Mold can also grow in conditions up to 140&#176;
    Fahrenheit.  High heat will kill mold, but it will also
    severely damage library materials.</p>

which is rendered

Most molds thrive at warmer temperatures. When combined with high levels of humidity, temperatures of 70 to 75° Fahrenheit will cause mold to develop. Temperatures below freezing will not kill mold, but they do make it dormant. Few molds will be active at temperatures of less than 50° Fahrenheit. Mold can also grow in conditions up to 140° Fahrenheit. High heat will kill mold, but it will also severely damage library materials.

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]


Walter Henry
Stanford University Libraries and Academic Information Resources