HTML實體

有些字元,像(<)這類的,對HTML標準通用標記語言下的一個套用)來說是有特殊意義的,所以這些字元是不允許在文本中使用的。要在HTML中顯示(<)這個字元,我們就必須使用實體字元。

基本介紹

  • 中文名:HTML實體
  • 外文名:Html Entity
  • 定義標準通用標記語言下的一個套用
  • 支持:最新的實體名稱
  • 注意:實體對大小寫敏感
實體字元,ASCII,符號實體,字元實體,

實體字元

一些字元在 HTML 中是預留的,擁有特殊的含義,比如小於號‘<’用於定義 HTML 標籤的開始。如果我們希望瀏覽器正確地顯示這些字元,我們必須在 HTML 源碼中插入字元實體。
字元實體有三部分:一個和號‘&’和一個實體名稱(或者一個‘#’ 和一個實體編號),以及一個分號‘;’。
要在 HTML 文檔中顯示小於號,我們需要這樣寫:&lt; 或者‘<’最後的效果則是<
使用實體名稱而不是實體編號的好處在於,名稱相對來說更容易記憶。而這么做的壞處是,並不是所有的瀏覽器都支持最新的實體名稱,然而幾乎所有的瀏覽器對實體編號的支持都很好。
注意:實體對大小寫敏感。

ASCII

結果描述實體名稱實體編號
"
quotation mark
&quot;
"
'
apostrophe
&apos;
'
&
ampersand
&amp;
&
<
less-than
&lt;
<
>
greater-than
&gt;
>

符號實體

結果描述實體名稱實體編號
non-breaking space
&nbsp;
¡
inverted exclamation mark
&iexcl;
¡
cent
&cent;
¢
pound
&pound;
£
¤
currency
&curren;
¤
yen
&yen;
¥
|
broken vertical bar
&brvbar;
¦
§
section
&sect;
§
¨
spacing diaeresis
&uml;
¨
©
copyright
&copy;
©
a
feminine ordinal indicator
&ordf;
ª
«
angle quotation mark (left)
&laquo;
«
¬
negation
&not;
¬
soft hyphen
&shy;
­
®
registered trademark
&reg;
®
ˉ
spacing macron
&macr;
¯
°
degree
&deg;
°
±
plus-or-minus
&plusmn;
±
2
superscript 2
&sup2;
2
3
superscript 3
&sup3;
3
spacing acute
&acute;
´
μ
micro
&micro;
µ
paragraph
&para;
·
middle dot
&middot;
·
¸
spacing cedilla
&cedil;
¸
1
superscript 1
&sup1;
1
o
masculine ordinal indicator
&ordm;
º
»
angle quotation mark (right)
&raquo;
»
¼
fraction 1/4
&frac14;
¼
½
fraction 1/2
&frac12;
½
¾
fraction 3/4
&frac34;
¾
¿
inverted question mark
&iquest;
¿
×
multiplication
&times;
×
÷
division
&divide;
÷

字元實體

結果描述實體名稱實體編號
à
capital a, grave accent
&Agrave;
À
á
capital a, acute accent
&Aacute;
Á
Â
capital a, circumflex accent
&Acirc;
Â
Ã
capital a, tilde
&Atilde;
Ã
Ä
capital a, umlaut mark
&Auml;
Ä
Å
capital a, ring
&Aring;
Å
Æ
capital ae
&AElig;
Æ
Ç
capital c, cedilla
&Ccedil;
Ç
è
capital e, grave accent
&Egrave;
È
é
capital e, acute accent
&Eacute;
É
ê
capital e, circumflex accent
&Ecirc;
Ê
Ë
capital e, umlaut mark
&Euml;
Ë
ì
capital i, grave accent
&Igrave;
Ì
í
capital i, acute accent
&Iacute;
Í
Î
capital i, circumflex accent
&Icirc;
Î
Ï
capital i, umlaut mark
&Iuml;
Ï
D
capital eth, Icelandic
&ETH;
Ð
Ñ
capital n, tilde
&Ntilde;
Ñ
ò
capital o, grave accent
&Ograve;
Ò
ó
capital o, acute accent
&Oacute;
Ó
Ô
capital o, circumflex accent
&Ocirc;
Ô
Õ
capital o, tilde
&Otilde;
Õ
Ö
capital o, umlaut mark
&Ouml;
Ö
Ø
capital o, slash
&Oslash;
Ø
ù
capital u, grave accent
&Ugrave;
Ù
ú
capital u, acute accent
&Uacute;
Ú
Û
capital u, circumflex accent
&Ucirc;
Û
ü
capital u, umlaut mark
&Uuml;
Ü
Y
capital y, acute accent
&Yacute;
Ý
T
capital THORN, Icelandic
&THORN;
Þ
ß
small sharp s, German
&szlig;
ß
à
small a, grave accent
&agrave;
à
á
small a, acute accent
&aacute;
á
a
small a, circumflex accent
&acirc;
â
ã
small a, tilde
&atilde;
ã
ä
small a, umlaut mark
&auml;
ä
å
small a, ring
&aring;
å
æ
small ae
&aelig;
æ
ç
small c, cedilla
&ccedil;
ç
è
small e, grave accent
&egrave;
è
é
small e, acute accent
&eacute;
é
ê
small e, circumflex accent
&ecirc;
ê
ë
small e, umlaut mark
&euml;
ë
ì
small i, grave accent
&igrave;
ì
í
small i, acute accent
&iacute;
í
î
small i, circumflex accent
&icirc;
î
ï
small i, umlaut mark
&iuml;
ï
e
small eth, Icelandic
&eth;
ð
ñ
small n, tilde
&ntilde;
ñ
ò
small o, grave accent
&ograve;
ò
ó
small o, acute accent
&oacute;
ó
ô
small o, circumflex accent
&ocirc;
ô
õ
small o, tilde
&otilde;
õ
ö
small o, umlaut mark
&ouml;
ö
ø
small o, slash
&oslash;
ø
ù
small u, grave accent
&ugrave;
ù
ú
small u, acute accent
&uacute;
ú
û
small u, circumflex accent
&ucirc;
û
ü
small u, umlaut mark
&uuml;
ü
y
small y, acute accent
&yacute;
ý
t
small thorn, Icelandic
&thorn;
þ
ÿ
small y, umlaut mark
&yuml;
ÿ
顯示結果描述實體名稱實體編號
空格
&nbsp;
<
&lt;
<
>
&gt;
>
&
和號
&amp;
&
"
引號
&quot;
"
'
撇號
&apos; (IE不支持)
'
&cent;
¢
&pound;
£
人民幣
&yen;
¥

相關詞條

熱門詞條

聯絡我們