资料来源: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: < 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 character entity.
三、HTML中的常用实体:
Result
|
Description
|
Entity Name
|
Entity Number
|
|
non-breaking space
|
|
|
<
|
less than
|
<
|
<
|
>
|
greater than
|
>
|
>
|
&
|
ampersand
|
&
|
&
|
"
|
quotation mark
|
"
|
"
|
'
|
apostrophe
|
' (does not work in IE)
|
'
|
-------------------------------------------------------------
生活就像打牌,不是要抓一手好牌,而是要尽力打好一手烂牌。
posted on 2008-06-02 22:11
Paul Lin 阅读(410)
评论(0) 编辑 收藏 所属分类:
Web基础