Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“我怎么能说?”;在HTML属性值中_Html_Escaping_Html Entities_Quotations - Fatal编程技术网

“我怎么能说?”;在HTML属性值中

“我怎么能说?”;在HTML属性值中,html,escaping,html-entities,quotations,Html,Escaping,Html Entities,Quotations,我希望有以下资料: <span title="This is a "good" title.">Catch me in the rice.</span> 在米饭里抓我。 很明显,浏览器无法很好地呈现这一点。请向我提供什么转义序列或编码的信息,如“我必须使用”使用“。抓住我的机会。 <span title="This is a &quot;good&quot; title.">Catch me in the rise.</span>

我希望有以下资料:

<span title="This is a "good" title.">Catch me in the rice.</span>
在米饭里抓我。
很明显,浏览器无法很好地呈现这一点。请向我提供什么转义序列或编码的信息,如“我必须使用”

使用

抓住我的机会。
<span title="This is a &quot;good&quot; title.">Catch me in the rise.</span>

用相应的HTML实体替换引号-例如,
&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>
在米饭里抓我。

太快了。让我试试这个。当他需要的文本中有一个单引号时,单引号将不起作用……始终使用实体。@gms8994当然是像