資料來源: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 閱讀(419)
評論(0) 編輯 收藏 所屬分類:
Web基礎