posts - 262,  comments - 221,  trackbacks - 0

资料来源:www.w3cschools.com

一、HTML中的实体(又译转义字符):
A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;).

备注:一个HTML实体由三部分构成:&符号、实体名或者一个#加实体编码、分号

To display a less than sign in an HTML document we must write: &lt; or <

The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.

备注:HTML实体是大小写敏感的

二、HTML中显示多个空白字符:
Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the &nbsp; character entity.

三、HTML中的常用实体: 

Result

Description

Entity Name

Entity Number

non-breaking space

&nbsp;

 

less than

&lt;

<

greater than

&gt;

>

&

ampersand

&amp;

&

"

quotation mark

&quot;

"

'

apostrophe 

&apos; (does not work in IE)

'



-------------------------------------------------------------
生活就像打牌,不是要抓一手好牌,而是要尽力打好一手烂牌。
posted on 2008-06-02 22:11 Paul Lin 阅读(348) 评论(0)  编辑  收藏 所属分类: Web基础

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年6月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(19)

随笔分类

随笔档案

BlogJava热点博客

好友博客

搜索

  •  

最新评论

阅读排行榜

评论排行榜