我希望有以下内容:
<span title="This is a "good" title.">Catch me in the rice.</span>
很明显,浏览器不能很好地渲染。请向我提供有关“我必须使用什么转义序列或编码”的信息?
我希望有以下内容:
<span title="This is a "good" title.">Catch me in the rice.</span>
很明显,浏览器不能很好地渲染。请向我提供有关“我必须使用什么转义序列或编码”的信息?
改为使用"
。
将引号替换为其对应的 HTML 实体——例如"
或"
)——如下所示:
<span title="This is a "good" title.">Catch me in the rice.</span>
<span title="This is a "good" title.">Catch me in the rice.</span>
或者,如果您需要在属性值中使用双引号,您可以在 HTML 中使用单引号:
<span title='This is a "good" title.'>Catch me in the rice.</span>
<span title="This is a "good" title.">Catch me in the rise.</span>