Some characters in HTML have to be represented in a special way. This is because as part of the language the character is used with a special purpose. Also to represent non-standard keyboard characters a special code may be used.
As an example the less than sign (<) which is used throughout HTML as the opening part of a tag definition=, needs to be represented in a different way.These are called character entities.
A character entity comprises three parts; an ampersand (&), an entity name, and finally a semicolon (;). To display a less than sign in an HTML document we must write: < Note that the entities are case sensitive.
Probably the most commonly used character entity is the non-breaking space. In HTML multiple spaces are realised as a single space. Therefore, to represent two or more spaces together we must take a different approac, the non-breaking space.
Commonly used character entities
| Code |
Description |
Result |
| |
Non-breaking space |
|
| < |
Less than |
< |
| > |
Greater than |
> |
| & |
Ampersand |
& |
| " |
Quotation mark |
" |
| ’ |
Apostrophe |
’ |
| ¢ |
Cent |
¢ |
| £ |
Pound |
£ |
| ¥ |
Yen |
¥ |
| § |
Section |
§ |
| © |
Copyright |
© |
| ™ |
Trademark |
™ |
| ® |
Registered trademark |
® |
| × |
Multiplication |
× |
| ÷ |
Division |
÷ |
NAT July 2005 (Revised)
|
This article viewed: 1281 times |
Back |
Copyright © 2004-2007 Janet Systems Ltd.