freeCodeCamp/guide/chinese/html/html-entities/index.md

49 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: HTML Entities
localeTitle: HTML实体
---
# HTML实体
## 概观
### 什么是HTML实体
HTML实体是用于替换HTML中的保留字符或键盘上未显示的字符的字符。某些字符在HTML中保留。如果在文本中使用小于<)或大于(>)的符号,浏览器可能会将它们与标记混合在一起。
### 它们用于什么?
如上所述HTML实体用于替换HTML保留的保留字符。
### 你是如何使用它们的?
字符实体看起来类似于:
```html
<!-- format &[entity_name]; -->
<!-- example for a less-than sign (<) -->
&lt;
```
要么
```html
<!-- &#[entity_number]; -->
<!-- example for a less-than sign (<) -->
&#60;
```
## 参考指南
这绝不是一个详尽的列表,但如果以下链接不能满足您的需求,下面的链接将能够为您提供更多实体。快乐编码:领结:
|人物|实体名称|实体编号|说明| | ------- | ----------- | ----------- | ------- | | | | `&#32;` |空间| | | | `&#33;` |感叹号| | “| | `&#34;` |引号| | | | `&#35;` |数字符号| | $ | | `&#36;` |美元符号| | ¢| `&cent;` | `&#162;` |分号| | €| `&euro;` | `&#8364;` |欧元符号| | £| `&pound;` | `&#163;` | GBP标志| | ¥| `&yen;` | `&#165;` |日元符号| | | | `&#37;` |百分号| | | `&amp;` | `&#38;` | &符号| | '| | `&#39;` |撇号| | | | `&#40;` |左/右括号| | | | `&#41;` |结束/右括号| | \* | | `&#42;` |星号| | + | | `&#43;` |加号| | | | `&#44;` |逗号| | - | | `&#45;` |连字符| | 。 | | `&#46;` |期间| | / | | `&#47;` |斜线| | ©| `&copy;` | `&#169;` |版权| | ®| `&reg;` | `&#174;` |注册商标| | “| `&quot;` | `&#34;` |双引号| | `>` | `&gt;` | `&#62;` |大于号| | `<` | `&lt;` | `&#60;` |小于标志| | `•` | `&bull;` | `&#8226` |子弹点|
#### 更多信息:
那里有很多HTML参考文献;一些例子是:
* [实体表 - W3](https://dev.w3.org/html5/html-author/charref)
* [W3学校](https://www.w3schools.com/html/html_entities.asp)
* [Freeformatter](https://www.freeformatter.com/html-entities.html)