我真的需要xmlns或前缀来使用opengraph元标记吗?

问题描述 投票:3回答:1

关于http://ogp.me,建议我使用:

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

令人困惑的是,他们在同一页面上链接到有关使用此的technical design decisions的文章:

<html xmlns:og="http://opengraphprotocol.org/schema/">

[我看了facebook.comtwitter.comstackoverflow.com的来源,它们都使用Opengraph元标记,但都不包含任何xmlns或前缀声明。] >

什么给了?

在http://ogp.me上,我建议使用:令人困惑的是,他们在同一页面上链接到有关使用此技术设计决策的文章:<...>

facebook-opengraph xml-namespaces
1个回答
0
投票

我的回答基本上是给定herehere的答案的重新整理。您应该使用prefix属性(较新的,更推荐的方法)或xmlns声明(等效;较旧的xhtml格式)来指定名称空间。但是,对于Opengraph元标记,您可以选择省略前缀/声明,因为Opengraph (among others)被广泛认可:

© www.soinside.com 2019 - 2024. All rights reserved.