HTML entities are used to display characters that have special meanings in HTML, such as reserved characters or characters that are not easily typed on a keyboard. Entities start with an ampersand (&
) and end with a semicolon (;
).
Here are some commonly used HTML entities:
&
- &<
- <>
- >"
- "'
- 'Here are some examples of HTML entities in use:
<p>Use <div> to create a block element.</p>
Use <div> to create a block element.
<p>The "quote" entity is used for double quotes.</p>
The "quote" entity is used for double quotes.
HTML entities can be represented either by named entities or numeric codes. For example:
©
- ©©
- ©<p>© 2024 ShariqSP</p>
© 2024 ShariqSP
To display characters like less than (<
) or greater than (>
) signs in HTML, use entities:
<p>The < and > signs are used for comparisons.</p>
The < and > signs are used for comparisons.