Symbols
Understanding HTML Symbols
HTML symbols, also referred to as character entities, allow you to display special characters that are either unavailable on a keyboard or have reserved meanings in HTML. Examples include currency symbols like the Rupee (₹) and Euro (€), which can be inserted using specific HTML codes.
Adding Symbols to an HTML Page
To use a symbol in HTML, you need to start with an ampersand (&
), followed by the entity name or numeric code, and end with a semicolon (;
). This helps prevent conflicts with HTML syntax.
Example Usage
The snippet below shows how to add different symbols using HTML entities:
Copyright: ©
Trademark: ™
Euro: €
<p>Copyright: ©</p>
<p>Trademark: ™</p>
<p>Euro: €</p>
Frequently Used Symbols
Registered Trademark: ®
Trademark: ™
Copyright: ©
Left Arrow: ←
<p>Registered Trademark: ®</p>
<p>Trademark: ™</p>
<p>Copyright: ©</p>
<p>Left Arrow: ←</p>
HTML Symbol Representation
Symbols in HTML can be displayed using their entity name, decimal code, or hexadecimal reference.
Example: Displaying the Euro Symbol
Euro Symbol: €
Using Decimal Code: €
Using Hex Code: €
<p>Euro Symbol: €</p>
<p>Using Decimal Code: €</p>
<p>Using Hex Code: €</p>
Character Entity Codes
Entities can be represented by named codes or Unicode numbers:
©
→ Copyright symbol(©)
€
→ Euro currency(€)
•
→ Bullet point(•)
♥
→ Heart(♥)
Currency Symbols in HTML
Here’s a reference table for common currency symbols and their HTML codes:
Symbol | Description | Entity Name | Entity Number |
---|---|---|---|
₹ | Indian Rupee | Not available | ₹ |
€ | Euro | € | € |
₿ | Bitcoin | Not available | ₿ |
¥ | Japanese Yen | ¥ | ¥ |
₽ | Russian Ruble | Not available | ₽ |
Using Decimal & Hexadecimal References
- Decimal Format: Uses
&#
followed by a number, e.g.,☺
(☺). - Hexadecimal Format: Uses
&#x
followed by a hexadecimal code, e.g.,☺
(☺).
Displaying Entity Codes with <code>
The <code>
element is useful when displaying entity codes in a webpage.
Example
The entity for the copyright symbol is ©
<p>The entity for the copyright symbol is <code>©</code></p>
<code>
tag may alter the appearance due to monospaced fonts.Conclusion
HTML symbols or character entities enable the inclusion of special characters that are not available on the keyboard or have specific meanings in HTML. These symbols can be represented through named entities, decimal codes, or hexadecimal values. They are crucial for displaying characters like currency symbols and trademarks correctly.
Typography
HTML typography utilizes elements such as headings, paragraphs, and lists to control text presentation, improving structure, emphasis, and readability through various tags and attributes.
Entities
HTML entities, derived from SGML, represent special characters using codes that begin with & and end with ;, ensuring correct display of symbols.