HTML Entities: Reserved characters in HTML should be replaced with character entities.
HTML character entities are used as a substitution of reserved characters in HTML. You can likewise replace characters that are absent on your keyboard by entities.
These characters are supplanted because a few characters are saved in HTML. HTML entities give a wide range of characters which can allow you to add icons, geometric shapes, mathematical operators, and so on
For instance: in the event that you use not exactly (<) or greater than (>) symbols in your content, the browser can mix them in with tags that is the reason character entities are used in HTML to show reserved characters.
In this tutorial, you will learn-
In this article, you will learn-
HTML Entities
A few characters are reserved in HTML.
In the event that you use the not exactly (<) or greater than (>) signs in your content, the browser might mix them with tags.
Character substances are used to show reserved characters in HTML.
A character entity resembles this:
&entity_name; OR &#entity_number;
To show a not exactly sign (<) we should write: < <
Benefit of using a entity name: An entity name is not difficult to recollect.
Disadvantage of using an entity name: Browsers may not support all entity names, but the support for entity numbers is good.
Non-breaking Space
A commonly used substance in HTML is the non-breaking space:
A non-breaking space is a space that won’t break into new line.
Two words separated by a non-breaking space will stay together (not break into another line). This is handy when breaking the words may be troublesome.
Example:
• § 10
• 10 km/h
• 10 PM
Another normal use of the non-breaking space is to keep browsers from truncating spaces in HTML pages.
On the off chance that you write 10 spaces in your content, the browser will eliminate 9 of them. To add real spaces to your content, you can use the character entity.
Some Useful HTML Character Entities
Result | Description | Entity Name | Entity Number |
non-breaking space | |   | |
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
“ | double quotation mark | " | " |
‘ | single quotation mark (apostrophe) | ' | ' |
¢ | cent | ¢ | ¢ |
£ | pound | £ | £ |
¥ | yen | ¥ | ¥ |
€ | euro | € | € |
© | copyright | © | © |
® | registered trademark | ® | ® |
Note: Entity names are case sensitive.
Combining Diacritical Marks
A diacritical mark is a “glyph” added to a letter.
Some diacritical marks, similar to grave ( ̀) and intense ( ́) are called highlights.
Diacritical marks can seem both above and under a letter, inside a letter, and between two letters.
Diacritical marks can be used in mix with alphanumeric characters to deliver a character that is absent in the character set (encoding) used in the page.
Here are a few examples:
Mark | Character | Construct | Result |
̀ | a | à | à |
́ | a | á | á |
̂ | a | â | â |
̃ | a | ã | ã |
̀ | O | Ò | Ò |
́ | O | Ó | Ó |
̂ | O | Ô | Ô |
̃ | O | Õ | Õ |
You will see more HTML symbols in the next chapter of this tutorial.
HTML Layout Elements and Techniques
Thanks for reading! We hope you found this tutorial helpful and we would love to hear your feedback in the Comments section below. And show us what you’ve learned by sharing your projects with us.