Using Character Entities for Special Characters

5:47:00 PM | ,


Using Character Entities for Special Characters

You can use most alphanumeric characters in your document and they will be displayed without a problem. There are, however, some characters that have special meaning in XHTML, and for some characters there is not an equivalent on the keyboard you can enter. For example, you cannot use the angle brackets that start and end tags, as the browser can mistake the following letters for markup. You can, however, use a set of different characters known as a character entity to represent these special characters. Sometimes you will also see character entities referred to as escape characters.
All special characters can be added into a document using the numeric entity for that character, and some also have named entities, as you can see in the table that follows.

Character        Numeric Entity                                Named Entity
”                            "                                                     "
&                          &                                                       &
<                         &#060;                                                         &lt;
>                         &#062;                                                          &gt;





0 comments: