HTML Entities and Special Characters
In HTML, entities are used to
display reserved characters, symbols, or special characters
that cannot be typed directly or may be misunderstood by the browser.
🔹 Why Use HTML Entities?
- Some characters like <, >, & are reserved in HTML and will be interpreted as
code if written directly.
- Entities help you display these characters correctly
on the page.
Example
<p>5 < 10 and 10 > 5</p><p>Use & to write "and".</p><p>Price: 100 €</p><p>© 2025 Your Name. All rights reserved.</p>
Output:
5 < 10 and 10 > 5
Use & to write "and".
Price: 100 €
© Your Name. All rights reserved.
🔹 Using Unicode with &#code;
You can also use numeric character references
(decimal or hex):
·
© → ©
·
® → ®