Content deleted Content added
updated |
m grammar |
||
Line 27:
Many symbolic character entities have been defined. For example, the character 'λ' can be encoded as <code>&lambda;</code>. This use of the '&' character as an [[escape character]] for character entities means that literal '&' characters in HTML need to be encoded as an entity themselves, as <code>&amp;</code>. A similar escapes is required for the '<' character, encoded as <code>&lt;</code>. The '>' character only needs to be encoded if it is part of an attribute value: it should then be encoded as <code>&gt;</code>. Note that this encoding is different from URL encoding, which uses a different method and is far more strict.
Decimal and hexadecimal HTML character references can also be used, based on the [[Unicode]] numeric code for the character encoded. For example, λ can also be represented as a decimal-coded character reference as <code>&#955;</code>. It is important to note that numeric references ''always'' refer to Unicode,
Note that unnecessary use of HTML character references may significantly reduce the readability of HTML. If the character encoding for a web page is chosen appropriately then HTML character references are usually only required for a few special characters. The characters '''&''' and '''<''' always need to be encoded, as noted above.
|