Why to use an escape string.
<,>,& in HTML has a special meaning (<,> for the link-sign,& for escape) and cannot be used directly. These symbols are not displayed in the pages we eventually see, so what if we want to display them in the Web page?
This is going to be about the HTML escape string (Escape Sequence).
An escape string (Escape Sequence) is also called a character entity (Character Entity). There are two reasons to define an escape string in HTML: The first reason is that symbols such as "<" and ">" are already used to represent HTML tags, so they cannot be used directly as symbols in text. In order to use these symbols in an HTML document, you need to define its escape string. When an interpreter encounters such a string, it interprets it as a real character. When you enter an escape string, strictly follow the rules for letter capitalization. The second reason is that some characters are not defined in the ASCII character set and therefore need to be represented using an escape string. the composition of the escape string
The Escape string (Escape Sequence), that is, the character entity (Character Entity) is divided into three parts: the first part is a & symbol, English is called Ampersand; the second part is the entity (Entity) name or the # Plus entity (Entity) number; The third part is a semicolon.
For example, to display the less than sign (<), you can write < or <.
The advantage of using entity (Entity) name is better understanding, a see LT, probably guess is less than meaning, but its disadvantage is not all browsers support the newest Entity name. The entity (Entity) number can be processed by various browsers.
Tip: Entity names (Entity) are case-sensitive.
Note: The same symbol can be referenced in two ways, "entity name" and "entity number", the advantage of "entity name" is that it is easy to remember, but it is not guaranteed that all browsers can identify it successfully, and "entity number" has no such concern, but it is inconvenient to remember. how to display spaces.
Typically, HTML automatically truncates extra spaces. No matter how many spaces you add, it's considered a space. For example, if you add 10 spaces between two characters, HTML will intercept 9 spaces, leaving only one. In order to add spaces to the page, you can use to represent spaces. HTML Special escape character list the most commonly used character entities
Character entities
Show |
Description |
Entity name |
Entity number |
|
Half a square big blank |
  |
|
|
The whole square big blank |
  |
|
|
Continuous line of blank spaces |
|
|
< |
Less than |
< |
< |
> |
Greater than |
> |
> |
& |
& Symbols |
& |
& |
" |
Double quotes |
" |
" |
© |
Copyright |
© |
© |
® |
Registered trademarks |
® |
® |
™ |
Trademarks (USA) |
™ |
™ |
X |
Multiplication |
× |
X |
÷ |
Division |
÷ |
÷ |
ISO 8859-1 (Latin-1) Character Set
HTML 4.01 supports the ISO 8859-1 (Latin-1) character set.
Note: For convenience, in the following table, "entity name" is referred to as "name", "entity number" is referred to as "number"
Show |
name |
number |
Show |
name |
number |
Show |
name |
number |
Show |
name |
number |
Show |
name |
number |
|
|
|
¡ |
¡ |
¡ |
¢ |
¢ |
¢ |
£ |
£ |
£ |
¤ |
¤ |
¤ |
¥ |
¥ |
¥ |
¦ |
¦ |
¦ |
§ |
§ |
§ |
¨ |
¨ |
¨ |
© |
© |
© |
ª |
ª |
ª |
« |
« |
« |
¬ |
¬ |
¬ |
|
­ |
|
® |
® |
® |
¯ |
¯ |
¯ |
° |
° |
° |
± |
± |
± |
² |
² |
² |
³ |
³ |
³ |
´ |
´ |
´ |
µ |
µ |
µ |
¶ |
¶ |
¶ |
· |
· |
· |
¸ |
¸ |
¸ |
¹ |
¹ |
¹ |
º |
º |
º |
» |
» |
» |
¼ |
¼ |
¼ |
½ |
½ |
½ |
¾ |
¾ |
¾ |
¿ |
¿ |
¿ |
À |
À |
À |
Á |
Á |
Á |
 |
 |
 |
Coal tar |