facebook open-graph 和 twitter 卡的有效 xhtml 元标记 [英] valid xhtml meta tags for facebook open-graph and twitter cards

查看:21
本文介绍了facebook open-graph 和 twitter 卡的有效 xhtml 元标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使有效:

  • xhtml
  • 推特卡片
  • facebook-graph-api

对于http://www.theyact.com/acting-classes/los-天使/

我已经设法让我的代码在任何地方都有效......
保存 1 个错误http://validator.w3.org/

I've managed to get my code to come up valid everywhere...
save 1 error on http://validator.w3.org/

没有属性property"

there is no attribute "property"

但在代码中的众多实例中只有 1 个实例,只有以下内容似乎激怒了验证者的羽毛:

but only 1 instance among the many in the code, only the below seems to ruffle the validator's feathers:

<meta name="og:description" property="og:description" content="...

<meta name="og:description" property="og:description" content="...

我希望代码在 validator.w3.org 眼中完全有效.我错过了什么?

I'd like the code to be completely valid in validator.w3.org's eyes. What am I missing?

推荐答案

如果您删除此元素,验证器将抱怨下一个包含 property 属性的元素.

If you remove this element, the validator will complain about the next one containing the property attribute.

property 属性是 RDFa 的一部分,但您的 DOCTYPE 不允许使用 RDFa.

The property attribute is part of RDFa, but your DOCTYPE doesn’t allow the use of RDFa.

如果您想继续使用 XHTML 1.1,您可以将其更改为:

If you want to keep using XHTML 1.1, you could change it to:

  • 适用于 RDFa 1.0: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">;

对于RDFa 1.1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">

或者干脆切换到 (X)HTML5,它支持 RDFa 1.1.

这篇关于facebook open-graph 和 twitter 卡的有效 xhtml 元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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