---
title: "HTML字符实体"
author: "小丑鱼0703"
date: "2014-04-24T15:01:24Z"
tags: []
categories: ["Web前端"]
slug: "html"
draft: false
lastmod: "2014-04-24T15:02:54Z"
id: 2054122
url: "https://wangjingyi.iteye.com/blog/2054122"
---

HTML 中的预留字符必须被替换为字符实体。

在 HTML 中不能使用小于号（<）和大于号（>），这是因为浏览器会误认为它们是标签。
如果希望正确地显示预留字符，我们必须在 HTML 源代码中使用字符实体（character entities）。

语法：&entity_name;  或者  &#entity_number;
注：实体名称对大小写敏感！


![](http://dl2.iteye.com/upload/attachment/0096/4367/6c4132cb-7139-37eb-a023-65a7e93e5229.png)

详细的字符实体手册：<http://www.w3school.com.cn/tags/html_ref_entities.html>