Answer
In HTML, there are some characters reserved for HTML markup, like <
, >
, /
, etc.,
If we need to use such characters on a web page, we cannot use them directly but we need to use their respective HTML entities.
Here is a list of some of the reserved characters and their entity names and numbers, any of them can be used.
Character | Entity Name | Entity Number |
< | < | < |
> | > | > |
& | & | & |
Example
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>HTML Entities</h1>
<p>HTML Entity for less than symbol: < or <</p>
<p>HTML Entity for greater than symbol: > or ></p>
<p>HTML Entity for ampersand symbol: & or &</p>
</body>
</html>
In the below example, we have used HTML entity names and numbers to include reserved characters.