没有属性“属性".在验证w3c的facebook meta标签中 [英] there is no attribute "property" in facebook meta tag in validation w3c

查看:124
本文介绍了没有属性“属性".在验证w3c的facebook meta标签中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以使用meta name="fb:admins" 代替 meta property="fb:admins" 用于w3c验证??

can we use the meta name="fb:admins" instead of meta property="fb:admins" for w3c validation ??

推荐答案

尽管这是一个老问题,但我正在回答这个问题,因为我认为这对于将来希望获得此信息的人来说都是有价值的.埃文(Evan)说不会通过验证时可能是对的,但我认为答案是您想保留property=""属性.取自旧Facebook恰好与此问题有关的开发人员论坛帖子,事实证明您的文档应该是XHTML + RDFa文档.借助于DOCTYPE声明,这将在W3C中进行验证:

I'm answering this even though this is an old question since I think it's of value for whoever wants info on this in the future. Evan's probably right when he says it won't pass validation, but I think the answer is that you want to keep the property="" attribute. Taking from an old Facebook developer forum post concerning this question exactly it turns out your document should be an XHTML + RDFa document. This will validate in W3C, thanks to the DOCTYPE declaration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
    version="XHTML+RDFa 1.0"
    xmlns:og="http://ogp.me/ns#"
    xml:lang="en">
  <head>
    <title>Virtual Library</title>
    <meta property="og:title" content="My Website"/>
  </head>
  <body>
    <p>Moved to <a href="http://example.org/">example.org</a>.</p>
  </body>
</html>

您可以在 RDFa的W3C规范中找到更多信息,并在<meta property=""/> 的特定示例.

You can find out more in in the W3C spec for RDFa, and in this specific example of <meta property=""/>.

这篇关于没有属性“属性".在验证w3c的facebook meta标签中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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