Html 简明教程
HTML - Symbols
通过 HTML 符号,我们能够通过名为实体的特殊代码嵌入键盘上不存在的符号。实体以 &( &
)开头,并以分号( ;
)结尾。
HTML symbols allow us to embed symbols that are not presents in keyboard using special codes called entities. Entities start with ampersand(&
) and end with semi column(;
).
What are HTML Symbols?
在 * HTML* 中,有一些带有特殊含义且难以直接用键盘输入的字符。它们常常称为 Symbols 。例如,除了美元符号外,我们无法在普通键盘上找到卢比和欧元等货币符号。然而,HTML 提供了其他方式在网页中插入这些符号。在该教程中,我们将学习如何在 HTML 文档中使用特殊字符或符号。
In HTML, there are some characters that holds a special meaning and are difficult to type directly by the keyboard. They are often termed as Symbols. For example, other than dollar symbol we can’t find any currency symbols like Rupees and Euro in normal keyboards. However, HTML provide other ways to insert these symbols into webpages. In this tutorial, we are going to learn how to use special characters or symbols in HTML document.
How to insert Symbols in HTML document?
要向 HTML 文档中插入符号,我们使用 * entities.* 。如果没有实体名称,则我们被允许使用实体编号,即十进制或十六进制引用。 HTML entity 是以 & 且以分号 (;) 结尾的一段文本。它们被用来表示要么在 HTML 中保留,要么在键盘中直接不可用而无法在网页中使用的字符和符号。
To insert symbols into an HTML document, we use entities. If no entity name exists then we are allowed to use entity number which is a decimal or a hexadecimal reference. An HTML entity is a piece of text that begins with an ampersand (&) and ends with a semicolon (;). They are used to represent characters and symbols that are either reserved in HTML, or not directly available in keyboards for use on the web page.
Example
下面的示例展示了如何向 HTML 文档中插入符号。
The following example shows how to insert symbols into an HTML document.
<!DOCTYPE html>
<html>
<head>
<title> Symbols in HTML </title>
</head>
<body>
<h1>Common HTML Symbols</h1>
<p>Registered trademark Symbol : ® </p>
<p>Trademark Symbol : ™ </p>
<p>Copyright Symbol : © </p>
<p>Left Arrow Symbol : ← </p>
</body>
</html>
Currency Symbols in HTML
下列表格展示了货币符号及其对应的实体:
The following table shows currency symbols and their corresponding entities:
Symbols |
Description |
Entity Name |
Entity Number |
₹ |
Indian Rupee Symbol |
NA |
₹ |
€ |
Euro Symbol |
€ |
€ |
₿ |
Bitcoin Symbol |
NA |
₿ |
¥ |
Japanese Yen Symbol |
¥ |
¥ |
₽ |
Ruble Symbol |
NA |
₽ |
Example
在下面的示例中,我们将使用其对应的实体显示几种货币符号:
In the following example, we are going to display a few currency symbols using their corresponding entities:
<!DOCTYPE html>
<html>
<head>
<title> Symbols in HTML </title>
</head>
<body>
<h1>Common Currency Symbols</h1>
<p>Indian Rupee Symbol : ₹ </p>
<p>Euro Symbol : € </p>
<p>Bitcoin Symbol : ₿ </p>
<p>Japanese Yen Symbol : ¥ </p>
</body>
</html>
Mathematical Symbols in HTML
下列表格展示了数学符号及其对应的实体:
The following table shows Mathematical symbols and their corresponding entities:
Symbols |
Description |
Entity Name |
Entity Number |
∀ |
For all symbol |
∀ |
∀ |
∅ |
Empty sets symbol |
∅ |
∅ |
∇ |
Nabla symbol |
∇ |
∇ |
∑ |
Summation symbol |
∑ |
∑ |
∈ |
Element of |
∈ |
∈ |
Example
在这个示例中,我们将演示如何在 HTML 文档中插入数学符号。
In this example, we will demonstrate how to insert mathematical symbols into an HTML document.
<!DOCTYPE html>
<html>
<head>
<title> Symbols in HTML </title>
</head>
<body>
<h1>Common Mathematical Symbols</h1>
<p>For all symbol : ∀ </p>
<p>Nabla symbol : ∇ </p>
<p>Empty sets symbol : ∅ </p>
<p>Summation symbol : ∑ </p>
</body>
</html>
要了解 HTML 中的所有符号,你可以访问我们的 * entities tutorial.*
To learn all the symbols in HTML, you can visit our entities tutorial.