HTML Entities
HTML Entities (HTML字符编码)
There are a lot of symbols that are not present on a standard keyboard (mathematical, technical, currency symbols, etc.). Also, there are symbols, which cannot be used because they can cause confusion. For example, we cannot use (>) greater than because in HTML this symbol stands for a tag, and the browser won’t show it. (标准键盘上没有许多符号(数学、技术、货币符号等)。此外,还有一些符号不能使用,因为它们会引起混淆。例如,我们不能使用(>)大于,因为在HTML中,此符号代表标记,浏览器不会显示它。)
In HTML, the entities display reserved characters, which can be confused with HTML code or invisible characters, like non-breaking spaces. Also, characters that are difficult or impossible to type with a keyboard. (在HTML中,实体显示保留字符,这些字符可能与HTML代码或不可见字符(如不间断空格)混淆。此外,还有难以或不可能用键盘键入的字符。)
You can use an HTML entity name to add such symbols to an HTML page. If an entity name does not exist, you can use a decimal, hexadecimal reference, or entity number. An entity name is easy to remember. But these names may not be supported by browsers. However, the support for numbers is good. (您可以使用HTML实体名称将此类符号添加到HTML页面。如果实体名称不存在,则可以使用十进制、十六进制引用或实体编号。实体名称很容易记住。但浏览器可能不支持这些名称。但是,对数字的支持很好。)
An HTML entity begins with an ampersand (&) and ends with a semicolon. (HTML实体以&开头,以分号结尾。)
Character Entities Commonly Used in HTML
Character Entities Commonly Used in HTML (HTML中常用的字符实体)
| Result | Description | Entity Name | Entity Number |
|---|---|---|---|
| non-breaking space | |||
| < | less than | < | < |
| > | greater than | > | > |
| & | ampersand | & | & |
| ¢ | cent | ¢ | ¢ |
| £ | pound | £ | £ |
| ¥ | yen | ¥ | ¥ |
| € | euro | € | € |
| § | section | § | § |
| © | copyright | © | © |
| ® | registered trademark | ® | ® |
| ™ | trademark | ™ | ™ |
Math Symbols Supported by HTML
Math Symbols Supported by HTML (HTML支持的数学符号)
| Character | Entity Number | Entity Name | Description |
|---|---|---|---|
| ∀ | ∀ | ∀ | for all |
| ∂ | ∂ | ∂ | part |
| ∃ | ∃ | ∃ | exists |
| ∅ | ∅ | ∅ | empty |
| ∇ | ∇ | ∇ | nabla |
| ∈ | ∈ | ∈ | isin |
| ∉ | ∉ | ∉ | notin |
| ∋ | ∋ | ∋ | ni |
| ∏ | ∏ | ∏ | prod |
| ∑ | ∑ | ∑ | sum |
| − | − | − | minus |
| ∗ | ∗ | ∗ | lowast |
| √ | √ | √ | square root |
| ∝ | ∝ | ∝ | proportional to |
| ∞ | ∞ | ∞ | infinity |
| ∠ | ∠ | ∠ | angle |
| ∧ | ∧ | ∧ | and |
| ∨ | ∨ | ∨ | or |
| ∩ | ∩ | ∩ | cap |
| ∪ | ∪ | ∪ | cup |
| ∫ | ∫ | ∫ | integral |
| ∴ | ∴ | ∴ | therefore |
| ∼ | ∼ | ∼ | similar to |
| ≅ | ≅ | ≅ | congruent to |
| ≈ | ≈ | ≈ | almost equal |
| ≠ | ≠ | ≠ | not equal |
| ≡ | ≡ | ≡ | equivalent |
| ≤ | ≤ | ≤ | less or equal |
| ≥ | ≥ | ≥ | greater or equal |
| ⊂ | ⊂ | ⊂ | subset of |
| ⊃ | ⊃ | ⊃ | superset of |
| ⊄ | ⊄ | ⊄ | not subset of |
| ⊆ | ⊆ | ⊆ | subset or equal |
| ⊇ | ⊇ | ⊇ | superset or equal |
| ⊕ | ⊕ | ⊕ | circled plus |
| ⊗ | ⊗ | ⊗ | circled times |
| ⊥ | ⊥ | ⊥ | perpendicular |
| ⋅ | ⋅ | ⋅ | dot operator |
Greek Letters Supported by HTML
Greek Letters Supported by HTML (HTML支持的希腊字母)
| Character | Entity Number | Entity Name | Description |
|---|---|---|---|
| Α | Α | Α | Alpha |
| Β | Β | Β | Beta |
| Γ | Γ | Γ | Gamma |
| Δ | Δ | Δ | Delta |
| Ε | Ε | Ε | Epsilon |
| Ζ | Ζ | Ζ | Zeta |
| Η | Η | Η | Eta |
| Θ | Θ | Θ | Theta |
| Ι | Ι | Ι | Iota |
| Κ | Κ | Κ | Kappa |
| Λ | Λ | Λ | Lambda |
| Μ | Μ | Μ | Mu |
| Ν | Ν | Ν | Nu |
| Ξ | Ξ | Ξ | Xi |
| Ο | Ο | Ο | Omicron |
| Π | Π | Π | Pi |
| Ρ | Ρ | Ρ | Rho |
| Σ | Σ | Σ | Sigma |
| Τ | Τ | Τ | Tau |
| Υ | Υ | Υ | Upsilon |
| Φ | Φ | Φ | Phi |
| Χ | Χ | Χ | Chi |
| Ψ | Ψ | Ψ | Psi |
| Ω | Ω | Ω | Omega |
| α | α | α | alpha |
| β | β | β | beta |
| γ | γ | γ | gamma |
| δ | δ | δ | delta |
| ε | ε | ε | epsilon |
| ζ | ζ | ζ | zeta |
| η | η | η | eta |
| θ | θ | θ | theta |
| ι | ι | ι | iota |
| κ | κ | κ | kappa |
| λ | λ | λ | lambda |
| μ | μ | μ | mu |
| ν | ν | ν | nu |
| ξ | ξ | ξ | xi |
| ο | ο | ο | omicron |
| π | π | π | pi |
| ρ | ρ | ρ | rho |
| ς | ς | ς | sigmaf |
| σ | σ | σ | sigma |
| τ | τ | τ | tau |
| υ | υ | υ | upsilon |
| φ | φ | φ | phi |
| χ | χ | χ | chi |
| ψ | ψ | ψ | psi |
| ω | ω | ω | omega |
| ϑ | ϑ | ϑ | theta symbol |
| ϒ | ϒ | ϒ | upsilon symbol |
| ϖ | ϖ | ϖ | pi symbol |
Other Entities Supported by HTML
Other Entities Supported by HTML (HTML支持的其他实体)
| Character | Entity Number | Entity Name | Description |
|---|---|---|---|
| Œ | Œ | Œ | capital ligature OE |
| œ | œ | œ | small ligature oe |
| Š | Š | Š | capital S with caron |
| š | š | š | small S with caron |
| Ÿ | Ÿ | Ÿ | capital Y with diaeres |
| ƒ | ƒ | ƒ | f with hook |
| ˆ | ˆ | ˆ | modifier letter circumflex accent |
| ˜ | ˜ | ˜ | small tilde |
| en space | |||
| em space | |||
| thin space | |||
| | | | zero width non-joiner |
| | | | zero width joiner |
| | | | left-to-right mark |
| | | | right-to-left mark |
| – | – | – | en dash |
| — | — | — | em dash |
| ‘ | ‘ | ‘ | left single quotation mark |
| ’ | ’ | ’ | right single quotation mark |
| ‚ | ‚ | ‚ | single low-9 quotation mark |
| “ | " | “ | left double quotation mark |
| ” | " | ” | right double quotation mark |
| „ | „ | „ | double low-9 quotation mark |
| ‡ | ‡ | ‡ | double dagger |
| • | • | • | bullet |
| … | … | … | horizontal ellipsis |
| ‰ | ‰ | ‰ | per mille |
| ′ | ′ | ′ | minutes |
| ″ | ″ | ″ | seconds |
| ‹ | ‹ | ‹ | single left angle quotation |
| › | › | › | single right angle quotation |
| ‾ | ‾ | ‾ | overline |
| ‾ | ‾ | ‾ | overline |
| € | € | € | euro |
| ™ | ™ or #153; | ™ | trademark |
| ← | ← | ← | left arrow |
| ↑ | ↑ | ↑ | up arrow |
| → | → | → | right arrow |
| ↓ | ↓ | ↓ | down arrow |
| ↔ | ↔ | ↔ | left right arrow |
| ↵ | ↵ | ↵ | carriage return arrow |
| ⌈ | ⌈ | ⌈ | left ceiling |
| ⌉ | ⌉ | ⌉ | right ceiling |
| ⌊ | ⌊ | ⌊ | left floor |
| ⌋ | ⌋ | ⌋ | right floor |
| ◊ | ◊ | ◊ | lozenge |
| ♠ | ♠ | ♠ | spade |
| ♣ | ♣ | ♣ | club |
| ♥ | ♥ | ♥ | heart |
| ♦ | ♦ | ♦ | diamond |
Non-breaking Space
Non-breaking Space (不间断空格)
The non-breaking space ( ) is one of the most common character entities used in HTML. It is a space that doesn’t break into a new line. This means, that two words that are divided by a non-breaking space will stay together. Besides, the non-breaking space stops browsers from truncating spaces in HTML pages. (不间断空格()是HTML中最常用的字符实体之一。这是一个不会分成新行的空间。这意味着,被不间断空格分隔的两个单词将保持在一起。此外,不间断的空格可阻止浏览器截断HTML页面中的空格。)
Diacritical Marks
Diacritical Marks (变音符)
When we say a diacritical mark, we mean a “glyph” that is added to a letter. Some of these marks, like grave ( ̀) and acute ( ́) are called accents. Diacritical marks may occur above and below a letter, between two letters or inside a letter. (当我们说变音符号时,我们指的是添加到字母中的“字形”。其中一些标记,如墓碑( grave )和尖锐( acute ) ,被称为重音符号。变音符号可能出现在字母的上方和下方、两个字母之间或字母内部。)
Here is a list containing some diacritical marks:
| Mark | Character | Construct | Result |
|---|---|---|---|
| ̀ | a | à | à |
| ́ | a | á | á |
| ̂ | a | â | â |
| ̃ | a | ã | ã |
| ̀ | O | Ò | Ò |
| ́ | O | Ó | Ó |
| ̂ | O | Ô | Ô |
| ̃ | O | Õ | Õ |