Search code examples
facebookfeed

Adding a Facebook feed to website causes problems


Does anyone know why when you add a Facebook feed to your website, in Firefox the closing head and opening body tags show up in red? Is there a way to combat this as W3 schools reckons that the website is not up to standard. Example click here

Thanks


Solution

  • The problem is that your div is inside the head element. <div id="fb-root"></div> and the following code needs to appear somewhere after the <body> tag.

    What's currently happening is your browser sees the <div> tag which can not appear inside <head>, so it implicitly closes the head and opens the body. Then, when your </head> tag appears, the browser rightfully complains about a duplicate closing tag.

    To fix it, you need to put that code inside the <body> where it belongs.