多个< meta>具有相同名称的标签 [英] Multiple <meta> Tags with the Same Name

查看:103
本文介绍了多个< meta>具有相同名称的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最好的方法是指定例如使用< meta> 标签的多个版权或作者?我们是否应该多次使用同名的< meta> 标签?

 < meta name =copyrightcontent =Company A/> 
< meta name =copyrightcontent =Company B/>

搜索引擎是否会尊重这两个值?或者,用逗号分隔它们会更好吗?



谢谢。

解决方案

使用具有相同名称的多个元标记是有效的HTML。



但我们不知道搜索引擎和其他读者如何解释它们。两个元标记将被连接,或者其中一个将被忽略/覆盖。



示例:PHP函数 get_meta_tags() 会忽略多个meta标签相同的名称。



为避免可能出现的问题,我建议使用一个元标记:

 < meta name =copyrightcontent =公司A,公司B/> 


What would be the best way to specify e.g. multiple copyrights or authors using the <meta> tag? Should we use a <meta> tag with the same name multiple times?

<meta name="copyright" content="Company A" />
<meta name="copyright" content="Company B" />

Will the search engine respect both values? Or, is it better to comma-separate them?

Thanks.

解决方案

Using multiple meta tags with the same name is valid HTML.

But we don't know how search engines and other readers will interpret them. Either two meta tags will be concatenated or one of them will be ignored/overwritten.

Example: The PHP-function get_meta_tags() will ignore multiple meta tags with an equal name.

To avoid possible problems I would recommend to use a single meta tag:

<meta name="copyright" content="Company A, Company B" />

这篇关于多个&lt; meta&gt;具有相同名称的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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