In HTML there is a special meaning for some characters like the < character and cannot be used in the text. We have to use a character entity to display a less than sign in HTML.
In HTML some characters have a special meaning by defining the start of an HTML tag by less than sign (<). We have to insert character entities in the HTML source if want to display actual characters in the browser.
There are three parts of a character: an ampersand (&), an entity name or a # and an entity number, and a semicolon finally.
We must write < or < to display a less than sign in HTML document. The name is used instead of a number because a name is easier to remember. The newest entity names are not supported by all the browsers. In almost all browsers the support for entity numbers is very good and the entities are case sensitive.
&entity_name; OR entity_number;
Result | Description | Entity Name | Entity Number |
---|---|---|---|
non-breaking space | | 160 | |
> | greater than | > | 62 |
& | ampersand | & | 38 |
< | less than | < | 60 |
© | copyright | © | 169 |
" | double quotation mark | " | 34 |
¢ | cent | ¢ | 162 |
£ | pound | £ | 163 |
' | single quotation mark (apostrophe) | ' | 39 |
¥ | yen | ¥ | 165 |
€ | Euro | € | 8364 |
® | registered trademark | ® | 174 |
There are some special types of letters used in HTML whichhave some glyph added to the top or below the letters. These glyphs are called diacritical mark.
Some diacritical marks, like grave ( ̀) and acute ( ́) are called accents.
Mark | Character | Construct | Result |
---|---|---|---|
̀ | a | à | à |
́ | a | á | á |
̂ | a | â | â |
̃ | a | ã | ã |
̂ | O | Ô | Ô |
̀ | O | Ò | Ò |
́ | O | Ó | Ó |
̃ | O | Õ | Õ |