2

我希望有以下内容:

<span title="This is a "good" title.">Catch me in the rice.</span>

很明显,浏览器不能很好地渲染。请向我提供有关“我必须使用什么转义序列或编码”的信息?

4

3 回答 3

5

改为使用&quot;

于 2010-05-25T21:00:04.303 回答
2

将引号替换为其对应的 HTML 实体——例如&quot;&#34;)——如下所示:

<span title="This is a &quot;good&quot; title.">Catch me in the rice.</span>
<span title="This is a &#34;good&#34; title.">Catch me in the rice.</span>

或者,如果您需要在属性值中使用双引号,您可以在 HTML 中使用单引号:

<span title='This is a "good" title.'>Catch me in the rice.</span>
于 2010-05-25T21:04:38.403 回答
1
<span title="This is a &quot;good&quot; title.">Catch me in the rise.</span>
于 2010-05-25T21:00:53.350 回答