Stay up late to sort out the most comprehensive HTML character entities, it's very easy to eat

HTML character entities

HTML character entities (Character Entities), escape string (Escape Sequence)

Why use escaped strings?

In HTML, <, >, & have special meanings (<,>, used for link signature, & used for escaping) and cannot be used directly. These symbols are not displayed on the webpage we finally see. What if we want to display these symbols on the webpage?

This is about HTML escape string (Escape Sequence).

Escape string (Escape Sequence), also known as character entities (Character Entity). In HTML, there are two reasons for defining escaped strings: The first reason is that symbols like "<" and ">" 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 its escape string. When the interpreter encounters such a string, it interprets it as a real character. When entering an escaped string, strictly follow the letter case rules. 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 composition of the escape string

Escape sequence (Character Entity) is divided into three parts: the first part is an ampersand, which is called ampersand in English; the second part is the entity (Entity) name or # plus the entity (Entity) number ; The third part is a semicolon.

For example, to display the less than sign (<), you can write &lt;or &#60;.

The advantage of using the Entity name is that it is easier to understand. When you look at lt, you might guess that it means less than, but the disadvantage is that not all browsers support the latest Entity name. The Entity number can be handled by various browsers.

Tip: Entity names are case sensitive.

Remarks: The same symbol can be quoted in two ways: "Entity Name" and "Entity Number". The advantage of "Entity Name" is that it is easy to remember, but it cannot be guaranteed that all browsers can identify it smoothly, while "Entity Number" There is no such worry, but it is really inconvenient to remember.

How to display spaces?

Under normal circumstances, HTML will automatically cut off extra spaces. No matter how many spaces you add, it is treated as one space. For example, if you add 10 spaces between two words, HTML will cut 9 spaces and only keep one. In order to add spaces in a web page, you can use the &nbsp;representation space.


List of HTML special escape characters

The most commonly used character entities

Character Entities

display Description Entity name Entity number
Half square blank &ensp; &#8194;
Big blank &emsp; &#8195;
Blank cell &nbsp; &#160;
< Less than &lt; &#60;
> more than the &gt; &#62;
& &symbol &amp; &#38;
" Double quotes &quot; &#34;
© copyright &copy; &#169;
® Registered trademark &reg; &#174;
Trademark (United States) &#8482;
× Multiplication sign &times; &#215;
÷ Division sign &divide; &#247;

ISO 8859-1 (Latin-1) character set

HTML 4.01 supports ISO 8859-1 (Latin-1) character set.

Note: For convenience, in the following table, "Entity Name" is referred to as "Name", and "Entity Number" is referred to as "Number"

display name Numbering display name Numbering display name Numbering display name Numbering display name Numbering
&nbsp; &#160; ¡ &iexcl; &#161; ¢ &cent; &#162; £ &pound; &#163; ¤ &curren; &#164;
¥ &yen; &#165; ¦ &brvbar; &#166; § &sect; &#167; ¨ &uml; &#168; © &copy; &#169;
ª &ordf; &#170; « &laquo; &#171; ¬ &not; &#172; &shy; &#173; ® &reg; &#174;
¯ &macr; &#175; ° &deg; &#176; ± &plusmn; &#177; ² &sup2; &#178; ³ &sup3; &#179;
´ &acute; &#180; µ &micro; &#181; &para; &#182; · &middot; &#183; ¸ &cedil; &#184;
¹ &sup1; &#185; º &ordm; &#186; » &raquo; &#187; ¼ &frac14; &#188; ½ &frac12; &#189;
¾ &frac34; &#190; ¿ &iquest; &#191; AT &Agrave; &#192; Á &Aacute; &#193; Â &Acirc; &#194;
à &Atilde; &#195; Ä &Auml; &#196; Oh &Aring; &#197; Æ &AElig; &#198; Ç &Ccedil; &#199;
IS &Egrave; &#200; IT'S &Eacute; &#201; Ê &Ecirc; &#202; E &Euml; &#203; Ì &Igrave; &#204;
Í &Iacute; &#205; Î &Icirc; &#206; Ï &Iuml; &#207; Ð &ETH; &#208; Ñ &Ntilde; &#209;
Ò &Ograve; &#210; Oh &Oacute; &#211; UMBRELLA &Ocirc; &#212; Õ &Otilde; &#213; Ö &Ouml; &#214;
× &times; &#215; Ø &Oslash; &#216; Ù &Ugrave; &#217; Ú &Uacute; &#218; Û &Ucirc; &#219;
Ü &Uuml; &#220; Italian &Yacute; &#221; Þ &THORN; &#222; ß &szlig; &#223; at &agrave; &#224;
á &aacute; &#225; â &acirc; &#226; ã &atilde; &#227; ä &auml; &#228; å &aring; &#229;
æ &aelig; &#230; ç &ccedil; &#231; is &egrave; &#232; It's &eacute; &#233; ê &ecirc; &#234;
e &euml; &#235; ì &igrave; &#236; í &iacute; &#237; î &icirc; &#238; ï &iuml; &#239;
ð &eth; &#240; ñ &ntilde; &#241; ò &ograve; &#242; oh &oacute; &#243; umbrella &ocirc; &#244;
õ &otilde; &#245; ö &ouml; &#246; ÷ &divide; &#247; ø &oslash; &#248; ù &ugrave; &#249;
ú &uacute; &#250; and &ucirc; &#251; ü &uuml; &#252; Italy &yacute; &#253; þ &thorn; &#254;
ÿ &yuml; &#255;

Math and Greek letter signs

symbols, mathematical symbols, and Greek letters

display name Numbering display name Numbering display name Numbering display name Numbering display name Numbering
ƒ &fnof; &#402; A &Alpha; &#913; Β &Beta; &#914; Γ &Gamma; &#915; Δ &Delta; &#916;
Ε &Epsilon; &#917; Ζ &Zeta; &#918; THE &Eta; &#919; Θ &Theta; &#920; Ι &Iota; &#921;
K &Kappa; &#922; Λ &Lambda; &#923; Μ &Mu; &#924; Ν &Nu; &#925; X &Xi; &#926;
THE &Omicron; &#927; Pi &Pi; &#928; P. &Rho; &#929; Σ &Sigma; &#931; Τ &Tau; &#932;
Υ &Upsilon; &#933; Phi &Phi; &#934; Χ &Chi; &#935; Ψ &Psi; &#936; Ω &Omega; &#937;
a &alpha; &#945; b &beta; &#946; c &gamma; &#947; d &delta; &#948; e &epsilon; &#949;
g &zeta; &#950; the &eta; &#951; θ &theta; &#952; ι &iota; &#953; K &kappa; &#954;
λ &lambda; &#955; μ &mu; &#956; ν &nu; &#957; X &xi; &#958; The &omicron; &#959;
Pi &pi; &#960; ρ &rho; &#961; ς &sigmaf; &#962; σ &sigma; &#963; τ &tau; &#964;
υ &upsilon; &#965; Phi &phi; &#966; χ &chi; &#967; ψ &psi; &#968; ω &omega; &#969;
? &thetasym; &#977; ? &upsih; &#978; ? &piv; &#982; &bull; &#8226; &hellip; &#8230;
&prime; &#8242; &Prime; &#8243; &oline; &#8254; &frasl; &#8260; &weierp; &#8472;
&image; &#8465; &real; &#8476; &trade; &#8482; A &alefsym; &#8501; &larr; &#8592;
&uarr; &#8593; &rarr; &#8594; &darr; &#8595; &harr; &#8596; &crarr; &#8629;
&lArr; &#8656; &uArr; &#8657; &rArr; &#8658; &dArr; &#8659; &hArr; &#8660;
&forall; &#8704; &part; &#8706; &exist; &#8707; &empty; &#8709; &nabla; &#8711;
&isin; &#8712; &notin; &#8713; &ni; &#8715; &prod; &#8719; &sum; &#8721;
&minus; &#8722; &lowast; &#8727; &radic; &#8730; &prop; &#8733; &infin; &#8734;
&ang; &#8736; &and; &#8743; &or; &#8744; &cap; &#8745; &cup; &#8746;
&int; &#8747; &there4; &#8756; &sim; &#8764; &cong; &#8773; &asymp; &#8776;
&ne; &#8800; &equiv; &#8801; &le; &#8804; &ge; &#8805; &sub; &#8834;
&sup; &#8835; &nsub; &#8836; &sube; &#8838; &supe; &#8839; &oplus; &#8853;
&otimes; &#8855; &perp; &#8869; &sdot; &#8901; ? &lceil; &#8968; ? &rceil; &#8969;
? &lfloor; &#8970; ? &rfloor; &#8971; ? &lang; &#9001; ? &rang; &#9002; &loz; &#9674;
&spades; &#9824; &clubs; &#9827; &hearts; &#9829; &diams; &#9830;

Important international mark

markup-significant and internationalization characters

display name Numbering display name Numbering display name Numbering display name Numbering display name Numbering
" &quot; &#34; & &amp; &#38; < &lt; &#60; > &gt; &#62; Π&OElig; &#338;
œ &oelig; &#339; Š &Scaron; &#352; š &scaron; &#353; Ÿ &Yuml; &#376; ˆ &circ; &#710;
˜ &tilde; &#732; &ensp; &#8194; &emsp; &#8195; θ &thinsp; &#8201; &zwnj; &#8204;
&zwj; &#8205; &lrm; &#8206; &rlm; &#8207; &ndash; &#8211; &mdash; &#8212;
&lsquo; &#8216; &rsquo; &#8217; &sbquo; &#8218; &ldquo; &#8220; &rdquo; &#8221;
&bdquo; &#8222; &dagger; &#8224; &Dagger; &#8225; &permil; &#8240; &lsaquo; &#8249;
&rsaquo; &#8250; &euro; &#8364;

JavaScript escape characters

Escape sequence character
\b backspace
\f Paper feed
\n Wrap
\r Carriage return
\t Horizontal tab (Ctrl-I)
apostrophe
" Double quotes
\ Backslash

Pay attention to the problem of special characters when programming. Many runtime problems are caused by the appearance of special characters.

I am currently working in front-end development. If you also want to learn front-end development technology now, and you encounter any questions about learning methods, learning routes, learning efficiency, etc. during the process of getting started learning front-end, you can apply to join my front-end learning Communication skirt: front: 421 middle: 374 last: 697. It gathers some beginners, changers, and beginners who are self-learning front-end. I also have some front-end learning manuals compiled during the time I was doing front-end technology, front-end interview questions, front-end development source code tutorials, PDF document book tutorials If you need it, you can get it from the skirt pig.

Note that because the backslash itself is used as an escape character, you cannot type a backslash directly in the script. If you want to generate a backslash, you must type two backslashes (\) together.

Guess you like

Origin blog.csdn.net/pig_html/article/details/111145739