A.2. HTML Character EntitiesHTML character entities are codes you can enter in a page that are then translated into other characters by the browser before they're displayed. All HTML character entities start with the ampersand (&) and end with the semicolon (;). There are two reasons you might want to use HTML character entities. First of all, you might want to use a character that is considered to have a special meaning in the HTML standard. For example, if you type < in an HTML document, the browser assumes you're starting a tag, which makes it difficult to write a pithy bit of logic like "2 < 3." To get around this, you can replace the < symbol with a character entity that represents the less-than symbol. The browser will then insert what you want when it displays the page. The other reason you might use HTML character entities is because you want to use a special character that's not easy to type, like an accented letter or a currency symbol. In fact, it's quite possibly not on your keyboard at all. Table A-2 has the most commonly used HTML entities. For the complete list, which includes many more international language characters, see http://webmonkey.wired.com/webmonkey/reference/special_characters. Table A-3. HTML Character Entities
|