Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In order to use the "og:" meta tag of Facebook Graph, I need to add the following to the tag:


Since I am using HTML5 and not XHTML, do I still need to use the xmlns="http://www.w3.org/1999/xhtml" part?



share|improve this question

You need xmlns="http://www.w3.org since xmlns:og and xmlns:fb are references to the xmlns - namespace. You need these because the og and fb tags are custom tags that are not part of the regular html. That is why the Validator doesn't like it if you omit it.

share|improve this answer

Not sure how the validator feels about this but as of RDFa 1.1 you should use prefix mappings and no xmlns.

      prefix="og: http://opengraphprotocol.org/schema/"
      prefix="fb: http://www.facebook.com/2008/fbml">
share|improve this answer

I haven't used Facebook Graph, but I believe those are required. They're technically only valid in xhtml, not html, but most browsers and even the w3.org validation don't care.

share|improve this answer
I tried the w3c validation on an html 5 page and w3c validation did care - it is not valid! – Perhentian Mar 2 '11 at 11:24


Once you declare <!doctype html> it's considered HTML5 thus you can omit the XHTML xmlns. I'd try to explain it but it looks like Dive Into Mark website does it spectacularly. Scroll down 'The Root Element' section. http://diveintohtml5.org/semantics.html

share|improve this answer
surely then xmlns:og would not be valid... – UpTheCreek Mar 18 '11 at 7:44
Well from my understanding, you can use either syntax (HTML4.01 or XHTML) under the new doctype. You will need to validate it under an HTML"5" enabled validator like validator.nu – Mike Mar 18 '11 at 17:05

Your Answer


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