HTML的特殊符号写法

一般在编写html页面的时候不时会碰到要写特殊符号在上面,比如上一页或是下一页的箭头,如果直接输入的话,在HTML验证的时候就无法通过。所以需要把这些字符用HTML的形式书写在代码里面,这样就能保证W3C的验证通过了。
这些符号被称为HTML字符实体或扩展字符。它们是由网页中形式怪异的代码所生成的,网页浏览器会将这些代码转换成符号。

一些较常用的HTML字符实体有:

  1. »  »  右双箭头
  2. «  «  左双箭头
  3. &lt;  <  左单箭头
  4. &gt;  >  右单箭头
  5. &bull;  •  项目隔点
  6. &#9829;  or  &hearts;  ♥  黑色心形
  7. &#9830;  or  &diams;  ♦  黑色菱形
  8. &#9827;  or  &clubs;  ♣  黑色梅花
  9. &#9824;  or  &spades;  ♠  黑色桃形
  10. &#8734;  ∞  无穷大符号
  11. &mdash;  —  长破折号

所有特殊字符对照

  1. " &quot;
  2. & &amp;
  3. < &lt;
  4. > &gt;
  5. &nbsp;
  6. ¡ &iexcl;
  7. ¢ &cent;
  8. £ &pound;
  9. ¤ &curren;
  10. ¥ &yen;
  11. ¦ &brvbar;
  12. § &sect;
  13. ¨ &uml;
  14. © &copy;
  15. ª &ordf;
  16. « &laquo;
  17. ¬ &not;
  18. ­ &shy;
  19. ® &reg;
  20. ¯ &macr;
  21. ° &deg;
  22. ± &plusmn;
  23. ² &sup2;
  24. ³ &sup3;
  25. ´ &acute;
  26. µ &micro;
  27. ¶ &para;
  28. · &middot;
  29. ¸ &cedil;
  30. ¹ &sup1;
  31. º &ordm;
  32. » &raquo;
  33. ¼ &frac14;
  34. ½ &frac12;
  35. ¾ &frac34;
  36. ¿ &iquest;
  37. À &Agrave;
  38. Á &Aacute;
  39. Â &Acirc;
  40. Ã &Atilde;
  41. Ä &Auml;
  42. Å &Aring;
  43. Æ &AElig;
  44. Ç &Ccedil;
  45. È &Egrave;
  46. É &Eacute;
  47. Ê &Ecirc;
  48. Ë &Euml;
  49. Ì &Igrave;
  50. Í &Iacute;
  51. Î &Icirc;
  52. Ï &Iuml;
  53. Ð &ETH;
  54. Ñ &Ntilde;
  55. Ò &Ograve;
  56. Ó &Oacute;
  57. Ô &Ocirc;
  58. Õ &Otilde;
  59. Ö &Ouml;
  60. × &times;
  61. Ø &Oslash;
  62. Ù &Ugrave;
  63. Ú &Uacute;
  64. Û &Ucirc;
  65. Ü &Uuml;
  66. Ý &Yacute;
  67. Þ &THORN;
  68. ß &szlig;
  69. à &agrave;
  70. á &aacute;
  71. â &acirc;
  72. ã &atilde;
  73. ä &auml;
  74. å &aring;
  75. æ &aelig;
  76. ç &ccedil;
  77. è &egrave;
  78. é &eacute;
  79. ê &ecirc;
  80. ë &euml;
  81. ì &igrave;
  82. í &iacute;
  83. î &icirc;
  84. ï &iuml;
  85. ð &eth;
  86. ñ &ntilde;
  87. ò &ograve;
  88. ó &oacute;
  89. ô &ocirc;
  90. õ &otilde;
  91. ö &ouml;
  92. ÷ &divide;
  93. ø &oslash;
  94. ù &ugrave;
  95. ú &uacute;
  96. û &ucirc;
  97. ü &uuml;
  98. ý &yacute;
  99. þ &thorn;
  100. ÿ &yuml;
  101. € &euro;

Ryan 发表于 星期四, 六月/3/2010 | 编程开发 | 0 条留言
标签:,

AddThis Social Bookmark Button

Leave a Reply