---
title: "XML和HTML常用转义字符"
author: "ezfantasy"
date: "2012-11-20T11:11:02Z"
tags: []
categories: ["Web前端"]
slug: "xml-html"
draft: false
lastmod: "2012-11-20T11:11:48Z"
id: 1730472
url: "https://ezfantasy.iteye.com/blog/1730472"
---

come from :[http://www.cnblogs.com/anjou/archive/2007/03/15/676476.html](http://www.cnblogs.com/anjou/archive/2007/03/15/676476.html)

 

XML和HTML中都有一些特殊的字符，这些字符在XML和HTML中是不能直接使用的，如果必须使用这些字符，应该使用其对应的转义字符。

XML常用转义字符：

**字符**

**转义字符**

**描述**

&

&amp;

和

&lt;

&lt;

小于号

&gt;

&gt;

大于号

"

&quot;

双引号

'

&apos;

单引号

HTML常用转义字符：

**字符**

**转义字符**

**描述**

&

&amp;

和

&lt;

&lt;

小于号

&gt;

&gt;

大于号

"

&quot;

双引号

 

&nbsp;

空格

©

&copy;

版权符

®

&reg;

注册符

说明：转义字符应以“&”开头，以“;”结尾。