Quick Solutions to Set Out Character Entities

To start practicing this, first understand what exactly it is: HTML5: Understanding Elements.

HTML elements may require special characters like > and <. These characters are referred to as entities. HTML allows you to insert such symbols in the content of an element by utilizing various character entities. The World Wide Web Consortium (W3C) refers to character entities as character encodings. Some characters, including Greek and Chinese, do not appear on the user’s keyboard. As a result, you cannot write them directly from the keyboard. However, you can avoid this issue by using character entities in an HTML document. Here are the Quick Solutions to Set Out Character Entities:

The character entity is formed of the following parts in sequential order:

  1. Ampersand symbol (&)
  2. Name of the entity
  3. A terminating semicolon

The following code snippet shows an example of a character entity:

The code sample above shows the character entity of a less than (<) symbol.

Character NameCharacterCharacter Entities
Less than sign<&lt;
Greater than sign>&gt;
Ampersand sign&&amp;
Quotation mark&quot;
Apostrophe&apos;
Table 1 – List of Character Entities

Working with Character Entities:

As explained in the IN-DEPTH section, character entities are reserved characters substituted by special characters. To understand the use of character entities, let’s build an HTML file called charactity.html by typing the code given below into Notepad:

The above code uses the & character entities to display the (&) symbols. Now, save the file and open it in your web browser.

Figure 6 – Displaying the output of using Character Entities

Scroll to Top