Lm7. Special Character Entities
Lm7. Special Character Entities
CLASS
HTML
ENTITIES
ENTITIES
Entities are used to display reserved characters or
special symbols in HTML.
Entities ensure these characters are displayed
correctly in a browser instead of being
misinterpreted as part of the HTML code.
Entities are written as &code; where code
represents the entity name or number.
WHY USE ENTITIES?
Reserved Characters:
Some characters, like <, >, and &, are used in HTML
tags. To display them as text, you need to use
entities.
Non-Keyboard Characters:
Some symbols, such as © or €, are not easily typed
on a keyboard, so their entities are used.
Prevent Code Errors:
Using entities avoids errors caused by browsers
interpreting special characters as HTML code.
TYPES OF ENTITIES
Named Entities
Use a descriptive name for the character.