HTML Entities - Detailed Overview

Introduction to HTML Entities

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 (;).

Common HTML Entities

Here are some commonly used HTML entities:

Examples

Here are some examples of HTML entities in use:

<p>Use &lt;div&gt; to create a block element.</p>

Use <div> to create a block element.

<p>The &quot;quote&quot; entity is used for double quotes.</p>

The "quote" entity is used for double quotes.

Using Named and Numeric Entities

HTML entities can be represented either by named entities or numeric codes. For example:

<p>&copy; 2024 ShariqSP</p>

© 2024 ShariqSP

Displaying Special Characters

To display characters like less than (<) or greater than (>) signs in HTML, use entities:

<p>The &lt; and &gt; signs are used for comparisons.</p>

The < and > signs are used for comparisons.