HTML character entity
In HTML documents, some characters are reserved and have special meanings. If you want to use these characters in the document content, you need to use character entities (character entities ).
The usage of character entities is as follows:
& Amp; entity_name; or & amp; # entity_number;
Entity_name indicates the name of the character entity. The name has meaning and is easier to remember. However, the disadvantage is that the browser does not support the name of the character entity, and some browsers do not support all object names.
Entity_number is the entity number, which is better supported by the browser.
Some common character entities are listed below:
Common character entity
Display result |
Description |
Entity name |
Entity ID |
|
Space |
|
|
< |
Yu no. |
< |
< |
> |
Yu no. |
> |
> |
& |
And number |
& |
& |
" |
Quotation marks |
" |
" |
' |
Marker |
'(Not supported by IE) |
' |
§ |
Section |
§ |
§ |
© |
Copyright |
© |
© |
® |
Registered Trademark |
® |
® |
? |
Trademark |
™ |
™ |
× |
Multiplication number |
× |
× |
Bytes |
Division Number |
Bytes |
Bytes |
Non-breaking space)
The browser always truncates spaces in the HTML page. If you write 10 spaces in the text, the browser will delete 9 of them and keep only one of them before the page is displayed. To increase the number of spaces on the page, you must use the ''character entity.