there is no attribute “property” in facebook meta tag in validation w3c

微笑、不失礼 提交于 2019-12-09 20:47:48

问题


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


回答1:


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>

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




回答2:


No, you'll just get this:

Line 1, Column 123: Bad value fb:app_id for attribute name on element meta: Keyword fb:app_id is not registered.
…="fb:app_id" content="176557225718913"><meta charset="utf-8"><meta name="descr…
Syntax of metadata name:
A metadata name listed in the HTML specification or listed in the WHATWG wiki. You can register metadata names on the WHATWG wiki yourself.


来源:https://stackoverflow.com/questions/6166820/there-is-no-attribute-property-in-facebook-meta-tag-in-validation-w3c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!