Search code examples
htmlw3c-validation

Errors "Stray end tag head" and "An body start tag seen but an element of the same type was already open"


If I try to do the W3C validation with my site (www.primapaginaonline.it), DOCTYPE HTML5, I get some errors, but there are two that I don't understand.

The first is the error

Line 110, Column 7: Stray end tag head.

and on line 110 there is only

</head>

The other error is

Line 111, Column 24: An body start tag seen but an element of the same type was already open.

And the code of line 111 is

<body class="home blog">

And after that it says it cannot continue. How can I solve these?


Solution

  • When you validate your site, you should start from the beginning. Remove earlier errors and then check if the error still exists.

    When I modified your code and only:

    <!DOCTYPE html>
    <html lang="it-IT" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
    
    <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    
    
    <title>
     Prima Pagina Online  
    </title>
    
    
    </head>
    

    was left at the beginning of file, there was no warning about head tag

    EDIT

    I looked at your code and the main problem is that you put Facebook code in head section. You should put it right after opening body tag.