HTML Entities and Symbols
What are HTML Entities?
HTML entities are used to display reserved characters, special symbols, or invisible characters in HTML that would otherwise be interpreted as code or cause formatting issues.
Why Use HTML Entities?
- To display special characters like <, >, &, ", '
- To insert symbols like ©, ®, €, →
- To include non-breaking spaces or invisible characters
Basic Syntax
&entity_name; or &#entity_number;
→ Non-breaking space
< → Less-than (<)
> → Greater-than (>)
& → Ampersand (&)
" → Double quote (")
' → Single quote (')
Common HTML Symbols
Symbol | Entity Name | Numeric Code |
---|---|---|
© | © | © |
® | ® | ® |
€ | € | € |
→ | → | → |
↑ | ↑ | ↑ |
↓ | ↓ | ↓ |
Non-Breaking Space
The entity prevents automatic line breaks between words or elements.
Best Practices
- Use entities for characters that conflict with HTML syntax (like <, >, &)
- Use to prevent unwanted line breaks
- Use numeric codes (&#...;) for less common or Unicode-based characters
- Avoid overusing entities; use normal characters where possible unless needed