Special Characters
Special characters in Html are characters with a special meaning which cannot be used directly in a HTML document without creating errors. These characters have specific reserved functions in Html, such as denoting tags, attributes and so on.
For example, the less than (<
) and greater than (>
) symbols are used as tags in Html. Using these operators in Html as bare text will lead to an error. To use them, you need character references.
Character references
Character references are sequences of characters that begin with an ampersand (&) and end with a semicolon (;). They are also called Html entities. You can use character references to represent operators such as less than (<
), greater than (<
), and so on.
Here are some of the commonly used special characters and their corresponding character references:
Special characters | Character references | Their meanings |
---|---|---|
< | < | This represents the less than sign. |
> | > | This represents the greater than sign. |
& | & | This represents the ampersand sign itself. |
" | " | This represents a double quotation mark. |
space | This represents a non-breaking space. | |
© | © | This represents the copyright symbol. |
® | ® | This represents the registered trademark symbol. |
™ | ™ | This represents the trademark symbol. |
€ | € | This represents the Euros currency. |
£ | £ | This represents the Pound sterling currency. |
¥ | ¥ | This represents the Japanese Yen currency. |
– | — | This represents an em dash. |
- | – | This represents an en dash. |
× | × | This represents the multiplication sign. |
÷ | ÷ | This represents the division sign. |
By using character references, you will ensure the special characters are properly represented in your Html document.
There are other character references in Html. You can check this link for a comprehensive list of characters references.