Original address
In HTML, some characters are reserved.
The less than sign (<) and greater than sign (>) cannot be used in HTML because the browser mistakenly considers them to be labels.
If you want to display reserved characters correctly, we must use the character entity (character entities) in the HTML source code. For example, to write this log in front of the display of greater than (>), less than (<) and so on must be in the background database to save these objects in the form of character entities.
The character entity looks like this:
&entity_name;
Or
& #entity_number;
To show the less than sign, we have to write this:< or & #60;
Tip: The advantage of using entity names instead of numbers is that names are easy to remember. The downside is that the browser may not support all entity names (the support for entity numbers is good).
Non-breaking space (non-breaking space)
The characters commonly used character entity in HTML is a nonbreaking space ().
The browser will always truncate the space in the HTML page. If you write 10 spaces in the text, the browser removes 9 of them before the page is displayed. To increase the number of spaces in the page, you need to use The character entity.
Useful character entities in HTML
Note: The entity name is case sensitive!
Show Results |
Description |
Entity name |
Entity number |
|
Space |
|
& #160; |
< |
Less than sign |
< |
& #60; |
> |
Greater than sign |
> |
& #62; |
& |
and number |
& |
& #38; |
" |
Quotes |
" |
& #34; |
‘ |
Apostrophe |
' (ie not supported) |
& #39; |
HTML character entity