Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

As far as I can tell, property is not a valid attribute of the <meta> tag in any of HTML 3, 4, XHTML-Transitional or XHTML-Strict. So why does the Open Graph Protocol (and Facebook's API docs) specify example code like this?

<html xmlns:og="http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />

This doesn't validate. Changing property to name does validate, and I can verify that, at least on Facebook, it still works as intended. So why do they use property in their example code?

http://opengraphprotocol.org/

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

They define their own custom DTD (definition of DTD). This allows them to create their own extension to the HTML standard and as long as they follow their own DTD they are technically ok. It won't be valid HTML but it doesn't have to be.

share|improve this answer
1  
Why not? How hard would it have been to do it right? –  reinierpost Sep 16 '10 at 8:38
    
Does it have to be pure HTML to be right? –  John Conde Sep 17 '10 at 11:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.