HTML Character Entity
Reserved characters in HTML must be replaced with character entities.
Some characters that are not found on the keyboard can also be replaced with character entities.
HTML Entity
In HTML, some characters are reserved.
In HTML, the less-than sign (<) and greater-than sign (>) cannot be used, as the browser will interpret them as tags.
In order to display reserved characters correctly, we must use character entities (character entities) in the HTML source code. Character entities look like this:
or
&#entity_number;To display the less-than sign, we must write it like this:<or <or<
Hint:The advantage of using entity names instead of numbers is that names are easier to remember. However, the downside is that not all browsers may support all entity names (but support for entity numbers is very good).
Non-breaking Space
Common character entities in HTML include the non-breaking space ( ).
Browsers always truncate spaces in HTML pages. Before displaying a page, they will delete 9 out of 10 spaces you write in the text. To increase the number of spaces on the page, you need to use the character entity.
Combining Diacritical Marks
An "glyph (character)" is added to a letter to produce an "intonation mark (diacritical mark)".
Some diacritical marks, such as the acute accent (̀) and the grave accent (́).
Diacritical marks can appear above and below a letter, inside a letter, or between two letters.
Diacritical marks can be used with combinations of letters and numeric characters.
Here are some examples:
| Diacritical Marks | Character | Construct | Output |
|---|---|---|---|
| ̀ | a | à | à |
| ́ | a | á | á |
| ̂ | a | â | â |
| ̃ | a | ã | ã |
| ̀ | O | Ò | Ò |
| ́ | O | Ó | Ó |
| ̂ | O | Ô | Ô |
| ̃ | O | Õ | Õ |
HTML Character Entity
![]() |
Entity names are case-sensitive! |
|---|
| Display Output | Description | Entity Name | Entity Number |
|---|---|---|---|
| Space | |   | |
| < | Less-than sign | < | < |
| > | Greater-than sign | > | > |
| & | Ampersand | & | & |
| " | Quotation marks | " | " |
| ' | Acute accent | ' (IE does not support) | ' |
| ¢ | Divide | ¢ | ¢ |
| £ | Pound | £ | £ |
| ¥ | Yuan/CNY, Yen/JPY | ¥ | ¥ |
| € | Euro | € | € |
| § | Section | § | § |
| © | Copyright | © | © |
| ® | Registered trademark | ® | ® |
| ™ | Trademark | ™ | ™ |
| × | Multiplication sign | × | × |
| ÷ | Division sign | ÷ | ÷ |
Although HTML is case-insensitive, character entities are case-sensitive.
To view the complete HTML entity reference on this site, please click here.HTML Entity Reference Manual。
Other Extensions