HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML
Reserved characters in HTML must be replaced with character entities.
HTML Entities
Some characters are reserved in HTML.It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags.
To actually display reserved characters, we must use character entities in the HTML source code.
A character entity looks like this:
| &entity_name; OR &#entity_number; |
Non-breaking Space
A common character entity used in HTML is the non-breaking space ( ).Browsers will always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them, before displaying the page. To add spaces to your text, you can use the character entity.
HTML Entities Example
Experiment with HTML character entities: Try it yourselfHTML Useful Character Entities
Note: Entity names are case sensitive!| Result | Description | Entity Name | Entity Number |
|---|---|---|---|
| non-breaking space | |   | |
| < | less than | < | < |
| > | greater than | > | > |
| & | ampersand | & | & |
| ¢ | cent | ¢ | ¢ |
| £ | pound | £ | £ |
| ¥ | yen | ¥ | ¥ |
| € | euro | € | € |
| § | section | § | § |
| © | copyright | © | © |
| ® | registered trademark | ® | ® |
| ™ | trademark | ™ | ™ |
HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, HTML Entities, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML, Entities HTML