Need for Character References
There are times where we will want to include characters like quotes(‘ or “), angle brackets( < or >) or ampersand(&). These symbols have special meaning in HTML and cannot be included directly. They have to be included using entity character references. The general format is:
&name; &#number;
A symbol can have a unique name or number or both. Anyone of the two methods can be used. Generally, the support for numbers is better than support for names in older browsers.
Symbols used in HTML
Result | Description | Entity Name | Entity Number |
---|---|---|---|
non-breaking space | |   | |
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
“ | double quotes | " | " |
‘ | single quotes (apostrophe) | ' | ' |
<p> Tom & Jerry</p>
Common Symbols
In some situations we may also want to add symbols like copyright and trademark. They can also be added using the same methods.
Result | Description | Entity Name | Entity Number |
---|---|---|---|
© | copyright | © | © |
® | registered trademark | ® | ® |
If you want to know about the entire list of symbols you can read the Wikipedia article on HTML and XML entity character references.