Entities
- HTML entities are special codes used to represent characters that have special meanings in HTML, such as reserved characters (like < and >) or characters with diacritics (accented characters).
- HTML entities are used to display these characters correctly on web pages and to avoid conflicts with HTML syntax.
Entity Table
Symbol | Meaning | Name | Number |
---|---|---|---|
non-breaking space | |   | |
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
" | double quotation mark | " | " |
' | single quotation mark (apostrophe) | ' | ' |
¢ | cent | ¢ | ¢ |
£ | pound | £ | £ |
¥ | yen | ¥ | ¥ |
€ | euro | € | € |
© | copyright | © | © |
® | registered trademark | ® | ® |
Example:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<h3>Entities example</h3>
<p>This is an example of <strong>HTML entities</strong>.</p>
<p>Visit us at <a href="https://www.example.com">example.com</a> for more info.</p>
</body>
</html>
Output: