Home >Web Front-end >HTML Tutorial >The most commonly used HTML escape characters Escape Sequence_HTML/Xhtml_Web page production
, &, etc. in HTML have special meanings ( is used for link tags, & is used for escaping) and cannot be used directly. These symbols are not displayed in the web page we finally see, so what should we do if we want to display these symbols in the web page?
This is about HTML escape string (Escape Sequence).
Escape Sequence is also called Character Entity. In HTML, there are two reasons for defining escaped strings: The first reason is that symbols such as "" have been used to represent HTML tags, so they cannot be used directly as symbols in text. In order to use these symbols in HTML documents, you need to define their escape strings. When the interpreter encounters such a string, it interprets it as a real character. When entering escape strings, strictly follow the rules for upper and lower case letters. The second reason is that some characters are not defined in the ASCII character set, so they need to be represented by escaped strings.
The Escape Sequence, that is, the character entity (Character Entity) is divided into three parts: the first part is an & symbol, called ampersand in English; the second part is the name of the entity (Entity) or # plus entity ( Entity) number; the third part is a semicolon.
For example, to display the less than sign (The advantage of using entity names is that they are easier to understand. When you look at lt, you can probably guess that it means less than. However, the disadvantage is that not all browsers support the latest Entity names. The 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 there is no guarantee that all browsers can successfully recognize it, and " "Entity Number" does not have this worry, but it is really inconvenient to remember.
The most commonly used character entities
Character Entities display description entity name entity number
Half square space | |||
Big blank space | |||
Continuous blank spaces | |||
is less than | |||
> | is greater than | > | > |
& | & symbol | & | & |
" | Double quotes | " | " |
© | Copyright | © | © |
® | Registered trademark | ® | ® |
™ | Trademark (USA) | ™ | ™ |
× | Multiply sign | × | × |
÷ | Division sign | ÷ | ÷ |