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
Character entities like this--->
& #60;or& #060;
tip: The advantage of using entity names instead of numbers is that names are easy to remember. The downside is that browsers may not support all entity names (support for entity numbers is good)
non-breaking spaces
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 Character entity
Phonetic symbol entity
Phonetic notation |
character |
Construct |
Output Results |
? |
A |
a& #768; |
A? |
? |
A |
a& #769; |
A? |
? |
A |
a& #770; |
A? |
? |
A |
a& #771; |
A? |
? |
O |
o& #768; |
O? |
? |
O |
o& #769; |
O? |
? |
O |
o& #770; |
O? |
? |
O |
o& #771; |
O?
|
Character entity
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; |
¢ |
Score of |
¢ |
& #162; |
£ |
Pounds |
£ |
& #163; |
¥ |
CNY/JPY |
¥ |
& #165; |
€ |
Euro |
€ |
& #8364; |
§ |
Section |
§ |
& #167; |
? |
Copyright |
© |
& #169; |
? |
Registered trademarks |
® |
& #174; |
? |
Trademark |
™ |
& #8482; |
X |
Multiplication sign |
× |
& #215; |
÷ |
Division Sign |
÷ |
& #247; |
13. HTML character entity