For the benefit of those who don't know, HTML special character codes are codes that you can use when writing HTML content and the exist for a number of reasons:
- Some characters don't appear on the keyboard. Special character codes provide a means of entering them.
- Some characters, the greater-than character for example, have a special meaning in HTML. If you want a browser to display those character rather than trying to interpret them as the part of an HTML tag, you need to use the special character code.
- Some characters are language and/or character set dependent (currency symbols being a good example). You need a way to force the viewers browser to display the correct character. Special character codes provide a way of doing this.
The list below is far from complete. There are many more codes to define all kinds of symbols and foreign characters with accents, umlauts and the like. The following list however shows the codes that I use the most frequently.
Code | Character | Description |
& | & | ampersand |
< | < | less-than sign |
> | > | greater-than sign |
| nonbreaking space | |
£ | £ | pound sterling |
€ | € | euro |
© | © | copyright |
™ | ™ | trademark sign |
® | ® | registered trademark |
° | ° | degree sign |
± | ± | plus or minus |
² | ² | superscript two |
³ | ³ | superscript three |
¼ | ¼ | one-quarter |
½ | ½ | one-half |
¾ | ¾ | three-quarters |
× | × | multiplication sign |
÷ | ÷ | division sign |
No comments:
Post a Comment