HTML - Symbols
HTML - Symbols
In HTML, you can embed the symbols and special characters that are not available on the keyboard using the HTML entities .
What are HTML Symbols?
HTML symbols are some characters that hold a special meaning and are difficult to type directly on the keyboard. They are often termed as โsymbols.โ For example, other than the dollar symbol, we canโt find any currency symbols like rupees and euros on normal keyboards. However, HTML provides other ways to insert these symbols into webpages. In this tutorial, we are going to learn how to use special characters or symbols in an HTML document.
Inserting Symbols in HTML Document
To insert symbols into an HTML document, we use entities. If no entity name exists, then we are allowed to use the entity number, which is a decimal or a hexadecimal reference. An HTML entity is a piece of text that begins with an ampersand (&) and ends with a semicolon (;). They are used to represent characters and symbols that are either reserved in HTML or not directly available on keyboards for use on the web page.
There are two types of HTML entities: named entities and numeric entities . The named entities use a descriptive name to refer to a character or symbol, such as ยฉ for the copyright symbol. Numeric entities use a number to refer to a character or symbol, such as ยฉ for the same symbol.
Example
The following example shows how to insert the most commonly used symbols into an HTML document.
When a user executes the above code, it will produce four different symbols, namely copyright, trademark, registered trademark, and left arrow.
HTML Currency Symbols
The following table shows currency symbols and their corresponding entities โ
| Symbols | Description | Entity Name | Entity Number |
|---|---|---|---|
| โน | Indian Rupee Symbol | NA | โน |
| โฌ | Euro Symbol | โฌ | โฌ |
| โฟ | Bitcoin Symbol | NA | โฟ |
| ยฅ | Japanese Yen Symbol | ยฅ | ยฅ |
| โฝ | Ruble Symbol | NA | โฝ |
Example: Inserting Currency Symbols in HTML
In the following example, we are going to display a few currency symbols using their corresponding entities โ
HTML Mathematical Symbols
The following table shows mathematical symbols and their corresponding entities โ
| Symbols | Description | Entity Name | Entity Number |
|---|---|---|---|
| โ | For all symbol | โ | โ |
| โ | Empty sets symbol | โ | โ |
| โ | Nabla symbol | โ | โ |
| โ | Summation symbol | โ | โ |
| โ | Element of | โ | โ |
Example: Inserting Mathematical Symbols in HTML
In this example, we will demonstrate how to insert mathematical symbols into an HTML document.
HTML Arrow Symbols
The following table shows arrows symbols and their corresponding entities โ
| Symbol | Entity Name | Entity Number | Description & Example |
|---|---|---|---|
| โ | โ | โ | Left Arrow: โ |
| โ | โ | โ | Up Arrow: โ |
| โ | โ | โ | Right Arrow: โ |
| โ | โ | โ | Down Arrow: โ |
| โ | โ | โ | Left-Right Arrow: โ |
Example: Inserting Arrow Symbols in HTML
In this example, we will demonstrate how to insert arrow symbols into an HTML document.
HTML Miscellaneous Symbols
The following table shows miscellaneous symbols and their corresponding entities โ
| Symbol | Entity Name | Entity Number | Description & Example |
|---|---|---|---|
| ยฉ | ยฉ | ยฉ | Copyright: ยฉ |
| ยฎ | ยฎ | ยฎ | Registered Trademark: ยฎ |
| โข | โข | โข | Trademark: โข |
| ยง | ยง | ยง | Section: ยง |
| ยถ | ยถ | ยถ | Paragraph: ยถ |
Example: Inserting Miscellaneous Symbols in HTML
In this example, we will miscellaneous how to insert arrow symbols into an HTML document: