8. HTML实体 {ignore}
[toc]
1. HTML Entity
实体字符,即:HTML Entity。
- HTML Entity mdn:https://developer.mozilla.org/zh-CN/docs/Glossary/Entity
- All HTML Enity:https://dev.w3.org/html5/html-author/charref
实体字符通常用于在页面中显示一些特殊符号。
2. 实体字符的两种写法
- &单词;
- &#数字;
3. 常见实体字符的书写
- 小于符号:<
< —— less than
< 或 < —— 等价于: < 也表示小于符号,不过数字不好记,一般情况下会使用单词。它们之间的对应关系可以到:https://dev.w3.org/html5/html-author/charref 这里面查。

- 大于符号:>
> —— great than
- 空格符号:
—— non-break space
- 版权符号:©
© —— 这个符号 © 搜狗输入法可以打出来,输入版权(banquan)两个字即可。
- &符号
&
小结
HTML entity 的两种写法:
- &单词;
- &#数字;
了解常见的 HTML entity:
- <
< - >
> - ©
© - 空格
- &
&
- <
