HTML Character Entities
Reserved characters in HTML must be replaced with character entities.
Some characters that cannot be found on the keyboard can also be replaced using character entities.
HTML Entities
Certain characters are reserved in HTML.
The less-than sign (<) and the greater-than sign (>) cannot be used in HTML because browsers may misinterpret them as tags.
To display reserved characters correctly, we must use character entities (character entities) in the HTML source code. Character entities look like this:
or
To display a less-than sign, we must write: < or < or <
Tip: The advantage of using entity names instead of numbers is that names are easier to remember. However, the downside is that browsers may not support all entity names (but they support entity numbers well).
Non-breaking Space
The common character entity in HTML is the non-breaking space ( ).
Browsers always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will delete 9 of them before displaying the page. To increase the number of spaces on a page, you need to use the character entity.
Combining Diacritical Marks
Diacritical marks are "glyphs" added to letters.
Some diacritical marks, such as the acute accent ( ̀) and the grave accent ( ́).
Diacritical marks can appear above and below letters, inside letters, or between two letters.
Diacritical marks can be used in combination with letters and numeric characters.
Here are some examples:
Diacritical Mark | Character | Construct | Output |
---|---|---|---|
̀ | a | à | à |
́ | a | á | á |
̂ | a | â | â |
̃ | a | ã | ã |
̀ | O | Ò | Ò |
́ | O | Ó | Ó |
̂ | O | Ô | Ô |
̃ | O | Õ | Õ |
HTML Character Entities
Entity names are case sensitive! | |||
---|---|---|---|
Display Result | Description | Entity Name | Entity Number |
--- | --- | --- | --- |
Space | |||
< | Less-than sign | < | < |
> | Greater-than sign | > | > |
& | Ampersand | & | & |
" | Quotation mark | " | " |
' | Apostrophe | ' (not supported by IE) | ' |
¢ | Cent | ¢ | ¢ |
£ | Pound | £ | £ |
¥ | Yen/Renminbi | ¥ | ¥ |
€ | Euro | € | € |
§ | Section | § | § |
© | Copyright | © | © |
® | Registered trademark | ® | ® |
™ | Trademark | ™ | ™ |
× | Multiplication sign | × | × |
÷ | Division sign | ÷ | ÷ |
Although HTML is not case-sensitive, entity characters are case-sensitive.
To view the complete list of HTML entities on this site, please click HTML Entity Reference.