Open Graph命名空间声明:带有XMLNS或头部前缀的HTML? [英] Open Graph namespace declaration: HTML with XMLNS or head prefix?

查看:253
本文介绍了Open Graph命名空间声明:带有XMLNS或头部前缀的HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有关如何最好地实现Open Graph命名空间的冲突信息。具体来说,Open Graph网站使用几种不同的方法,而Facebook Open Graph示例使用其他方法。

I have seen conflicting information on how to best implement Open Graph namespaces. Specifically, the Open Graph website uses a few different methods, and the Facebook Open Graph examples use other methods.

Open Graph网站示例(使用HTML前缀属性):

Open Graph website example (using HTML prefix attribute):

<html prefix="og: http://ogp.me/ns#">

Open Graph网站源代码(使用HTML XMLNS属性):

Open Graph website source code (using HTML XMLNS attribute):

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#">

Facebook Open Graph文档(使用HEAD前缀属性):

Facebook Open Graph documentation (using HEAD prefix attribute):

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">

Facebook Open Graph文档#2(使用HTML XMLNS属性):

Facebook Open Graph documentation #2 (using HTML XMLNS attribute):

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" 
      xmlns:fb="https://www.facebook.com/2008/fbml">

推荐的方法是甚么,甚至不起作用?

What is the recommended method or does it not even matter?

推荐答案

它们都是等效的,都可以正常工作。

They are all equivalent and will all work.

使用前缀,因为它是新的推荐方式,是较少的字符。

Use prefix as it is the new recommended way and is fewer characters.

我将把我们所有的文档更新为前缀。

I'll get all our documentation updated to prefix.

这篇关于Open Graph命名空间声明:带有XMLNS或头部前缀的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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