kotsirokolos
kotsirokolos

Reputation: 13

Website does not validate even after clarifying Facebook's Open Graph protocol

I followed the instructions at Facebook Developers Page, but this is still not validating. Why is this?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta property="og:image" content="image.png" >
more meta
</head>
<html>

Upvotes: 1

Views: 723

Answers (1)

animuson
animuson

Reputation: 54739

The xmlns property is only allowed in XHTML documents, you can't specify that in HTML. Try:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Also, it appears that even with the document type changed to XHTML, the property attribute is still not allowed on a meta element.

The following XHTML only produces the single error for the property attribute:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta property="og:image" content="image.png" />
<title>title</title>
</head>
<body>body</body>
</html>

Edit: I have found a document type that you can use that will pass at the W3C checker. It appears that this document type already uses XHTML 1.1 even though the title says 1.0 (not sure).

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

Upvotes: 1

Related Questions