我可以在meta标签中使用HTML字符实体吗? [英] Can I use HTML character entities in meta tags?

查看:195
本文介绍了我可以在meta标签中使用HTML字符实体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用两种语言的网站-英文和中文.在使用UTF-8字符集的英语首页中,例如:

I have a web site in two languages - English and Chinese. In the English homepage, which uses UTF-8 charset, I have, e.g.:

<meta name="description" content="Available in English and Chinese">

出现在搜索结果中.我想将其更改为:

That appears in search results. I would like to change it to:

<meta name="description" content="Available in English and &#20013;&#25991;">

...,其中&#20013;&#25991;是中文"的ISO实体.会在搜索结果中将其显示为中文"吗?我无法将中文"直接粘贴到Textpad *的HTML文件中(粘贴为??).

...where &#20013;&#25991; is the ISO entity for "Chinese". Would that be rendered as "中文" in the search results? I can't paste "中文" directly into the HTML file in Textpad* (pastes as ??).

*更新使用的是Textpad7.现在有了Textpad 8,它内部以Unicode UTF-16编码进行操作"(

* Update Was using Textpad 7. Now have Textpad 8, which "operates internally in Unicode UTF-16 encoding" (https://www.textpad.com/support/relnotes.html#v802), and allows me to paste "中文" into the meta tags.

推荐答案

我可以在meta标签中使用HTML字符实体吗?

Can I use HTML character entities in meta tags?

是的.您无法在HTML中使用实体的地方很少而且相去甚远(在脚本和样式元素的主体中,只有这样的地方才浮现在脑海.)

Yes. Places where you can't use entities in HTML are few and far between (in the bodies of script and style elements are the only ones that spring to mind).

会在搜索结果中显示为中文"吗?

Would that be rendered as "中文" in the search results?

假设:

  • 搜索引擎没有与此相关的错误
  • 搜索引擎的算法选择了描述作为要显示的内容

这篇关于我可以在meta标签中使用HTML字符实体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆