How to use an entity:
We can use an entity in your HTML document by name or by a numerical character reference. Each entity starts with symbol ampersand (&) and ends with a semicolon (;).
HTML character entities are used as a replacement of reserved characters in HTML. We can also replace characters that are not present on your keyboard by entities.
These characters are replaced because some characters are reserved in HTML.
HTML entities provide a wide range of characters which can allow you to add icons, geometric shapes, mathematical operators, etc.
For example: if we use less than (<) or greater than (>) symbols in your text, the browser can mix them with tags that's why character entities are used in HTML to display reserved characters.
We can use an entity in your HTML document by name or by a numerical character reference. Each entity starts with symbol ampersand (&) and ends with a semicolon (;).
&entity_name; OR &#entity_number;
Result | Description | Entity Name | Entity Number |
---|---|---|---|
non-breaking space | | 160 | |
< | less than | < | 60 |
> | greater than | > | 62 |
' | single quotation mark (apostrophe) | ' | 39 |
" | double quotation mark | " | 34 |
© | copyright | © | 169 |
® | registered trademark | ® | 174 |
& | ampersand | & | 38 |
¢ | cent | ¢ | 162 |
£ | pound | £ | 163 |
¥ | yen | ¥ | 165 |
€ | Euro | € | 8364 |