HTML Entities
HTML Tutorial
HTML Entities
CompletedReserved characters in HTML should be replaced by character entities.
inclusion of Characters which are not present on your keyboard can also be done using entities.
HTML Entities
CompletedIn HTML, Some characters are kept reserved .
when you are using the less than (<) or greater than (>) signs in your text, the browser can possibily mix them with tags.
Character entities are utilised for displaying reserved characters in HTML.
A character entity will appear like this:
&entity_name;
OR
&#entity_number;
for displaying a less than sign (<) we must write: < or <
Non-breaking Space
CompletedA common character entity which is predominantly used in HTML is the non-breaking space:
A non-breaking space can be said as a space which will not be breaking into a new line.
Two words that are separated using a non-breaking space will stick together (i.e not break into a new line). This is useful and handy while breaking the words might become disruptive.
Examples:
- § 10
- 10 km/h
- 10 PM
Another common usage of the non-breaking space is prevention of browsers for truncating spaces in HTML pages.
If you are using 10 spaces in your text, 9 of them will be removed by the browser.For adding real spaces to your text, usage of character entityis helpful.
Some Other Useful HTML Character Entities
Completed| Result | Description | Entity Name | Entity Number |
|---|---|---|---|
| non-breaking space | |   | |
| < | less than | < | < |
| > | greater than | > | > |
| & | ampersand | & | & |
| ¢ | cent | ¢ | ¢ |
| £ | pound | £ | £ |
| ¥ | yen | ¥ | ¥ |
| € | euro | € | € |
| © | copyright | © | © |
| ® | registered trademark | ® | ® |
Combination of Diacritical Marks
CompletedA diacritical mark can be called as a "glyph" which is added to a letter.
Some of the diacritical marks, such as grave ( ̀) and acute ( ́) are called accents.
Diacritical marks can be appearing at both above and below a letter or inside a letter or in-between two letters.
combinations of diacritical marks can also be utilised in combination, to produce a character that is not present in the character set (encoding) used in the page.
you can see some examples here:
| Mark | Character | Construct | Result |
|---|---|---|---|
| ̀ | a | à | à |
| ́ | a | á | á |
| ̂ | a | â | â |
| ̃ | a | ã | ã |
| ̀ | O | Ò | Ò |
| ́ | O | Ó | Ó |
| ̂ | O | Ô | Ô |
| ̃ | O | Õ | Õ |
We can see more of HTML symbols in the following chapter of this tutorial.
