valid xhtml meta tags for facebook open-graph and twitter cards

倖福魔咒の 提交于 2020-01-19 06:21:07

问题


to make valid:

  • xhtml
  • twitter cards
  • facebook-graph-api

for http://www.theyact.com/acting-classes/los-angeles/

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

there is no attribute "property"

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="...

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


回答1:


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

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

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

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

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

Or simply switch to (X)HTML5, which comes with RDFa 1.1 support.



来源:https://stackoverflow.com/questions/19947385/valid-xhtml-meta-tags-for-facebook-open-graph-and-twitter-cards

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