To replace the reserved characters in HTML, as well as to replace the characters that are not present on a keyboard, the HTML character entities are used. It thus provides a wide range of characters to add icons, geometric shapes, mathematical operators, etc. To use an entity in an HTML document one can either use it by name or by a numerical character reference. The ampersand (&) and the semicolon (;) symbols are used to start and end an entity respectively.
&entity_name; OR &#entity_number;
Advantages of using Entity Name:
It is easy to remember an entity name.
Disadvantages of using Entity Name:
All entity names may not be supported by every browser. However, the support for the entity numbers is good.
Popular HTML Character Entities:
|Result||Description||Entity Name||Entity Number|
|non-breaking space|| || |
|“||double quotation mark||"||"|
|‘||single quotation mark (apostrophe)||'||'|
<!DOCTYPE html> <html> <body> <p>"HELLO WORLD!!"</p> <p><HELLO WORLD!!></p> </body> </html>
In the above example, we used the Entity Number to replace the reserved character in HTML.
HTML Diacritical Marks:
The “glyph” added to the HTML letters to the top or below the letters, inside a letter, or between two letters, is called the HTML diacritical mark. The HTML Diacritical marks, like grave ( ̀) and acute ( ́) are often known as accents. Some of the HTML diacritical marks are: