HTML Character Entities
Some characters like the < character, have a special meaning in HTML, and therefore can not be used in the text.
To display a less than sign (<) in HTML, we have to use a character entity.
Character Entities
A character entity has three parts:
- an ampersand (
&),
- an entity name or a
# and an entity number, and
- finally a semicolon (
;).
To display a less than sign in an HTML document, use < or <.
Non-Breaking Space
Normally HTML will truncate spaces in your text.
If you write 10 spaces in your text HTML will remove 9 of them.
To add spaces to your text, use the character entity.
The Most Common Character Entities
The HTML Entities Reference gives a full list of HTML character entities.
| Result |
Description |
Entity Name |
Entity Number |
|
Result |
Description |
Entity Name |
Entity Number |
| |
non-breaking space |
|
  |
< |
less than |
< |
< |
| > |
greater than |
> |
> |
& |
ampersand |
& |
& |
| " |
quotation mark |
" |
" |
' |
apostrophe |
' |
' |
| ¢ |
cent |
¢ |
¢ |
£ |
pound |
£ |
£ |
| ¥ |
yen |
¥ |
¥ |
§ |
section |
§ |
§ |
| © |
copyright |
© |
© |
® |
registered trademark |
® |
® |
| × |
multiplication |
× |
× |
÷ |
division |
÷ |
÷ |
Demonstration
The following demonstration shows how the HTML script is displayed on the Web.
I told my wife she should embrace her mistakes.
She gave me a hug.
|