Facebook Debugger Error: Meta Tags In Body

Facebook Debugger Error: Meta Tags In Body

当我在 Facebook 调试器中检查我的网站时,出现此错误:

Errors That Must Be Fixed

Meta Tags In Body Your page has meta tags in the body instead of the head. >This may be because your HTML was malformed and they fell lower in the parse >tree. Please fix this in order for the tags to be usable.

我相信这个错误也会导致所有其他标签变得无效。

我已经尝试了很多小时来定位正文中的元标记,并查看了源代码,但我在正文中找不到任何内容时遇到了麻烦。我已经用 Google 的结构化数据测试工具对其进行了测试,但没有显示任何错误。它显示了通过 json、itemprop 和 属性 制作的同一组织的 3 个相同版本(这很糟糕吗?)。

我看过其他关于它的Whosebug问题,他们似乎通过让其他人查看他们的主页源来获得帮助。

我知道我的元标记不是很整洁或优化,但现在我真的需要修复这个错误。我感谢任何可以解决它的敏锐观察!

Post 评论:

识别和修复 HTML 错误的好工具:http://validator.w3.org/ 另一个 HTML 具有实时响应的改进工具:http://www.dirtymarkup.com/

<!DOCTYPE html>必须放在<html>之前,第68行没用注释,第103行也错了

编辑

为了美化您的代码,您可以使用 http://www.dirtymarkup.com/

你有很多语法问题。你的文档的头部看起来像这样:

<html lang="en" class="no-js"> <!--<![endif]-->
<!doctype html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="ie9 no-js"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->

文档类型应该在 <html> 标签之前,而不是之后。此外,您还有一堆无效元素,例如 <html itemscope itemtype="http://schema.org/Organization" />.

查看 W3 Validator's take on your page。有很多很多问题需要解决。