If you tried adding the Facebook Like button to your website and you’re using HTML5, be prepared for invalid markup failures in your HTML validator. The button should still render in browsers, but the XFBML tags are not considered valid HTML5. Thus, when you validate as HTML5, you’ll see validation errors like this:
Element name fb:like cannot be represented as XML 1.0
Element fb:like not allowed as child of element div in this context.
The problem is that you’re using the XFBML code to render the FB like button. Fortunately, there’s now a simple(ish) solution.
Ignore all other deprecated blog posts about doing funky things like document.write(), or training voals to fix your code.
Facebook has the option of grabbing HTML5 valid code when you create your Like button. After you click the “Get Code” button, you should see the HTML5 option.