HTML Entities

Some characters are reserved in HTML.

It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags.

To actually display reserved characters, we must use character entities in the HTML source code.

A character entity looks like this:

&entity_name;

OR

&#entity_number;

To display a less than sign we must write: &lt; or <

 Tip: The advantage of using an entity name, instead of a number, is that the name is easier
to remember. However, the disadvantage is that browsers may not support all entity names (the support for entity numbers is very good).


Non-breaking Space

A common character entity used in HTML is the non-breaking space (&nbsp;).

Browsers will always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them, before displaying the page. To add spaces to your text, you can use the &nbsp; character entity.


HTML Entities Example

Experiment with HTML character entities: 

filename=tryhtml_entities" style="line-height:21px; text-decoration:none; color:rgb(144,11,9); background-color:transparent">Try
it yourself


HTML Useful Character Entities

Note: Entity names are case sensitive!

Result Description Entity Name Entity Number
  non-breaking space &nbsp;  
< less than &lt; <
> greater than &gt; >
& ampersand &amp; &
? cent &cent; ¢
?

pound &pound; £
?

yen &yen; ¥
?

euro &euro;
§ section &sect; §
? copyright &copy; ©
? registered trademark &reg; ®
? trademark &trade;

For a complete reference of all character entities, visit our HTML Entities
Reference
.

HTML ISO-8859-1 Reference


Modern browsers supports several character-sets:


ISO-8859-1

ISO-8859-1 is the default character set in most browsers.

The first 128 characters of ISO-8859-1 is the original ASCII character-set (the numbers from 0-9, the uppercase and lowercase English alphabet, and some special characters).

The higher part of ISO-8859-1 (codes from 160-255) contains the characters used in Western European countries and some commonly used special characters.

Entities are used to implement reserved characters or to express characters that cannot easily be entered with the keyboard.


Reserved Characters in HTML

Some characters are reserved in HTML and XHTML. For example, you cannot use the greater than or less than signs within your text because the browser could mistake them for markup.

HTML and XHTML processors must support the five special characters listed in the table below:

Character Entity Number Entity Name Description
" " &quot; quotation mark
' ' &apos; apostrophe 
& & &amp; ampersand
< < &lt; less-than
> > &gt; greater-than

Note: Entity names are case sensitive!


ISO 8859-1 Symbols

Character Entity Number Entity Name Description
    &nbsp; non-breaking space
? ¡ &iexcl; inverted exclamation mark
? ¢ &cent; cent
? £ &pound; pound
¤ ¤ &curren; currency
? ¥ &yen; yen
? ¦ &brvbar; broken vertical bar
§ § &sect; section
¨ ¨ &uml; spacing diaeresis
? © &copy; copyright
? ª &ordf; feminine ordinal indicator
? « &laquo; angle quotation mark (left)
? ¬ &not; negation
  ­ &shy; soft hyphen
? ® &reg; registered trademark
? ¯ &macr; spacing macron
° ° &deg; degree
± ± &plusmn; plus-or-minus 
? ² &sup2; superscript 2
?

³ &sup3; superscript 3
?

´ &acute; spacing acute
? µ &micro; micro
?

&para; paragraph
· · &middot; middle dot
?

¸ &cedil; spacing cedilla
?

¹ &sup1; superscript 1
?

º &ordm; masculine ordinal indicator
? » &raquo; angle quotation mark (right)
? ¼ &frac14; fraction 1/4
?

½ &frac12; fraction 1/2
?

¾ &frac34; fraction 3/4
? ¿ &iquest; inverted question mark
× × &times; multiplication
÷ ÷ &divide; division

ISO 8859-1 Characters

Character Entity Number Entity Name Description
? À &Agrave; capital a, grave accent
?

Á &Aacute; capital a, acute accent
? Â &Acirc; capital a, circumflex accent
? Ã &Atilde; capital a, tilde
? Ä &Auml; capital a, umlaut mark
?

Å &Aring; capital a, ring
? Æ &AElig; capital ae
?

Ç &Ccedil; capital c, cedilla
?

È &Egrave; capital e, grave accent
? É &Eacute; capital e, acute accent
?

Ê &Ecirc; capital e, circumflex accent
? Ë &Euml; capital e, umlaut mark
? Ì &Igrave; capital i, grave accent
? Í &Iacute; capital i, acute accent
? Î &Icirc; capital i, circumflex accent
?

Ï &Iuml; capital i, umlaut mark
?

Ð &ETH; capital eth, Icelandic
? Ñ &Ntilde; capital n, tilde
? Ò &Ograve; capital o, grave accent
? Ó &Oacute; capital o, acute accent
?

Ô &Ocirc; capital o, circumflex accent
? Õ &Otilde; capital o, tilde
? Ö &Ouml; capital o, umlaut mark
?

Ø &Oslash; capital o, slash
?

Ù &Ugrave; capital u, grave accent
? Ú &Uacute; capital u, acute accent
? Û &Ucirc; capital u, circumflex accent
? Ü &Uuml; capital u, umlaut mark
? Ý &Yacute; capital y, acute accent
? Þ &THORN; capital THORN, Icelandic
? ß &szlig; small sharp s, German
à à &agrave; small a, grave accent
á á &aacute; small a, acute accent
? â &acirc; small a, circumflex accent
?

ã &atilde; small a, tilde
?

ä &auml; small a, umlaut mark
? å &aring; small a, ring
? æ &aelig; small ae
?

ç &ccedil; small c, cedilla
è è &egrave; small e, grave accent
é é &eacute; small e, acute accent
ê ê &ecirc; small e, circumflex accent
?

ë &euml; small e, umlaut mark
ì ì &igrave; small i, grave accent
í í &iacute; small i, acute accent
? î &icirc; small i, circumflex accent
?

ï &iuml; small i, umlaut mark
? ð &eth; small eth, Icelandic
? ñ &ntilde; small n, tilde
ò ò &ograve; small o, grave accent
ó ó &oacute; small o, acute accent
?

ô &ocirc; small o, circumflex accent
?

õ &otilde; small o, tilde
?

ö &ouml; small o, umlaut mark
?

ø &oslash; small o, slash
ù ù &ugrave; small u, grave accent
ú ú &uacute; small u, acute accent
? û &ucirc; small u, circumflex accent
ü ü &uuml; small u, umlaut mark
? ý &yacute; small y, acute accent
? þ &thorn; small thorn, Icelandic
?

ÿ &yuml; small y, umlaut mark

最新文章

  1. Android -- 常见控件的小效果
  2. merge,join,concat
  3. hibernate常用关联
  4. [转]Windows系统中监控文件复制操作的几种方式
  5. project.json
  6. javascript的语句和函数
  7. C# 调用 C++ dll (类型对照)
  8. NGUI自适应分辨率,黑边自动填充, 无黑边,等比例缩放
  9. Android Studio无法启动 打开, Android Studio gradle下载不了
  10. iOS UIScrollView的简单使用
  11. VB.NET版机房收费系统---导出Excel表格
  12. Wcf 文件上传下载
  13. 【贪心】【堆】Gym -100956D - Greedy Game
  14. Ubuntu系统下搭建PPTP类型VPN环境
  15. poj2689Prime Distance(大区间筛素数)
  16. JavaEE中的MVC(五)定制Struts——Action跳转JSP
  17. Python PEP8 编码规范中文版
  18. spring 的 transactionManager 事务管理器 配置
  19. TypeSrcript如何引入第三方库 如果加d.ts以及async await如何使用 demo,只有代码,文字后续补充
  20. 初始化后,composer安装

热门文章

  1. python中的有趣用法
  2. HDU 2227 Find the nondecreasing subsequences (线段树)
  3. china-pub
  4. poj 1979 Red and Black(dfs)
  5. 1294 - Positive Negative Sign(规律)
  6. 正确的lnamp支持SSI的方法!即支持SHTML和include调用!
  7. Ceph之数据分布:CRUSH算法与一致性Hash
  8. 【linux】 linux gpio操作
  9. SQL Server 基础 05 多链表查询和子查询
  10. CRC校验