Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
655 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...