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

HTML - HTML Commonly Used Character Entities的更多相关文章

  1. HTML字符实体(Character Entities),转义字符串(Escape Sequence)

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

  2. HTML字符实体(Character Entities),转义字符串(Escape Sequence)【转】

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

  3. HTML字符实体(Character Entities),转义字符串(Escape Sequence) 转

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

  4. [转]HTML字符实体(Character Entities),转义字符串(Escape Sequence)

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

  5. HTML字符实体(Character Entities)与 转义字符串(Escape Sequence)(转)

    为什么要用转义字符串?HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希望 ...

  6. List of XML and HTML character entity references

    A character entity reference refers to the content of a named entity. An entity declaration is creat ...

  7. 【译】DTD - Entities

    原文:DTD - Entities 实体用于定义XML文档中特殊字符的快捷方式. 实体主要有四种类型: 内置实体(Built-in entities) 字符实体(Character entities) ...

  8. SCALA XML pattern attrbute(属性)

    from: Working with Scala's XML Support 虽然这个guy炒鸡罗嗦,但是还是讲到我要的那句话:  Because Scala doesn't support XML ...

  9. java转换 HTML字符实体,java特殊字符转义字符串

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

随机推荐

  1. CoreAnimation —— CALayer

    概述 如上篇博文讲述,UIView中封装了很多系统方法,可以满足我们的大部分需求.但是,其也有很多限制.那些方法产生的动画基本单元为UIView,是非常重量级的对象,而且也不支持三维布局,大部分是对视 ...

  2. Winsock编程基础介绍 .

    相信很多人都对网络编程感兴趣,下面我们就来介绍,在网络编程中应用最广泛的编程接口Winsock API. 使用Winsock API的编程,应该了解一些TCP/IP的基础知识.虽然你可以直接使用Win ...

  3. 关于jave在oracle驱动下事务提交与回滚问题

    一直以来,都觉得Connection假设设置了setAutoCommit(false)后.启动手工事务提交.必须手工进行commit或者rollback才行.今天正好遇到一个问题.结果大跌眼镜. 于是 ...

  4. HDU 3974 Assign the task 简单搜索

    根据Rex 的思路才知道可以这么写. 题目意思还是很好理解的,就是找到当前雇员最近的任务. 做法是,可以开辟一个 tim 变量,每次有雇员得到昕任务时候 ++tim 然后取寻找最近的任务的时候写一个搜 ...

  5. 设计模式 ( 十六 ) 观察者模式Observer(对象行为型)

    设计模式 ( 十六 ) 观察者模式Observer(对象行为型) 1.概述 一些面向对象的编程方式,提供了一种构建对象间复杂网络互连的能力.当对象们连接在一起时,它们就可以相互提供服务和信息. 通常来 ...

  6. PLSQL Developer过期要注冊表

    打开执行输入 regedit 打表注冊表 删除 HKEY_CURRENT_USER\Software\Allround Automations HKEY_CURRENT_USER\Software\M ...

  7. phantomjs环境搭建已经运行

    1.下载phantomjs http://phantomjs.org/ 2.运行 新建phantomjs.bat,记得改目录路径 里面内容为: D:\java\phantomjs\phantomjs. ...

  8. stm32内部的CAN总线

    功能概述: bxCAN是基本扩展CAN(Basic Extended CAN)的缩写,它支持CAN协议2.0A和2.0B:它的设计目标是以最小的CPU负载来高效处理大量的报文.它也支持报文发送的优先级 ...

  9. 获取sdcard和内存的存储空间

    package com.example.sdcardspace; import java.io.File; import android.os.Bundle; import android.os.En ...

  10. sql基础,必须会的————随便整理、杂乱无章

    1.sqlserver2008r2的安装 2.数据库与表的建立.增加.删除.修改. 3,索引的概念,包括聚集与非聚集的区别.全文索引的建立与如何使用全文索引. 4,重新生成索引,重新组织索引. 5,建 ...