01 Sep 2017
HTML Entities
Some reserved characters in HTML have special meaning when used in HTML page, these characters are not present on our keyboard and can be replaced by entities. For example, we cannot use less then (<) and greater then (>) with your HTML text because the browser might mix them with tags.
To display a less then (<) we should write <.
Example:
If you want to write <div id = “my_div”> as a code then you will have to write as follows −
<html>
<head>
<title>HTML Entities</title>
</head>
<body>
<div id = "my_div">
</body>
</html>
<head>
<title>HTML Entities</title>
</head>
<body>
<div id = "my_div">
</body>
</html>
Output:
Some HTML Character Entities
Result | Description | Entity Name | Number Code |
---|---|---|---|
< | less than | < | < |
> | greater than | > | > |
non-breaking space | |   | |
& | ampersand | & | & |
“ | quotation mark | " | " |
‘ | apostrophe | ' | ' |
¢ | cent | ¢ | ¢ |
£ | pound | £ | £ |
¥ | yen | ¥ | ¥ | © | copyright | © | © |
€ | euro | € | € |
® | registered trademark | ® | ® |
Some HTML Entities for Arrows
Mnemonic | Code | Result | Description |
---|---|---|---|
↓ | ↓ | = ↓ | downwards arrow | ← | ← | = ← | leftwards arrow |
→ | → | = → | rightwards arrow |
↔ | ↔ | = ↔ | left right arrow |
↵ | ↵ | = ↵ | downwards arrow with corner leftwards |
⇐ | ⇐ | = ⇐ | leftwards double arrow |
⇑ | ⇑ | = ⇑ | upwards double arrow |
⇒ | ⇒ | = ⇒ | rightwards double arrow |
⇓ | ⇓ | = ⇓ | downwards double arrow |
⇔ | ⇔ | = ⇔ | left right double arrow |
Some Mathematical Operators
Mnemonic | Code | Result | Description |
---|---|---|---|
∂ | ∂ | = ∂ | partial differential |
∃ | ∃ | = ∃ | there exists |
∀ | ∀ | = ∀ | for all |
∅ | ∅ | = ∅ | empty set = null set = diameter |
∇ | ∇ | = ∇ | nabla = backward difference |
∈ | ∈ | = ∈ | element of |
∋ | ∋ | = ∋ | contains as member |
∉ | ∉ | = ∉ | not an element of |
∏ | ∏ | = ∏ | n-ary product = product sign |
∑ | ∑ | = ∑ | n-ary sumation |
− | − | = − | minus sign |
√ | √ | = √ | square root = radical sign |
∝ | ∝ | = ∝ | proportional to |
∗ | ∗ | = ∗ | asterisk operator |
∞ | ∞ | = ∞ | infinity |
∠ | ∠ | = ∠ | angle |
∴ | ∴ | = ∴ | therefore |
∧ | ∧ | = ∧ | logical and = wedge |
∨ | ∨ | = ∨ | logical or = vee |
∩ | ∩ | = ∩ | intersection = cap |
∪ | ∪ | = ∪ | union = cup |
∫ | ∫ | = ∫ | integral |
∼ | ∼ | = ∼ | tilde operator = varies with = similar to |
Other Entities Supported by HTML Browsers
Result | Description | Entity Name | Number Code |
---|---|---|---|
Œ | capital ligature OE | Œ | Œ |
– | en dash | – | – |
— | em dash | — | — |
‘ | left single quotation mark | ‘ | ‘ |
’ | right single quotation mark | ’ | ’ |
‚ | single low-9 quotation mark | ‚ | ‚ |
“ | left double quotation mark | “ | “ |
” | right double quotation mark | ” | ” |
„ | double low-9 quotation mark | „ | „ |
† | dagger | † | † |
‡ | double dagger | ‡ | ‡ |
… | horizontal ellipsis | … | … |
‰ | per mille | ‰ | ‰ |
‹ | single left-pointing angle quotation | ‹ | ‹ |
› | single right-pointing angle quotation | › | › |
€ | euro | € | € |
œ | small ligature oe | œ | œ |
Š | capital S with caron | Š | Š |
š | small S with caron | š | š |
Ÿ | capital Y with diaeres | Ÿ | Ÿ |
ˆ | modifier letter circumflex accent | ˆ | ˆ |
˜ | small tilde | ˜ | ˜ |