Reserved Characters and HTML Entities
As explained in Chapter 3, some special characters are not recognized in the content part of the HTML element. Those characters are called reserved characters.
An HTML entity is a special code used to represent a reserved character or special character that may not be displayed properly in the browser. HTML entities are sometimes called escape characters in the context of avoiding reserved characters.
Here is a list of key reserved characters and HTML entities for their replacement.
- < (less than) :
<
- > (greater than) :
>
- & (ampersand) :
&
- ' (single quotation mark) :
'
- " (double quotation mark) :
"
Example – tags < > in HTML content
For example, in HTML documents, < and > are used as an HTML tag. Thus, when you use them as content, they won't be rendered in the browser like in the example below.
When you want to use < or > in your content, you need to use <
(less-than) for < and >
(greater-than) for > like in the example below.