Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "Stray end tag html" from W3C Validator

Tags:

html

I'm checking my (HTML5) site using W3C's validator and getting the following error:

Stray end tag html. 
<html lang="en-US">

And the error sign is on the closing ">" there. What is wrong with that line? It seems to be exactly right.

like image 955
ispiro Avatar asked Dec 10 '12 13:12

ispiro


People also ask

How do you resolve a stray end tag?

An end tag </code> has been found violating nesting rules. Check other errors in the same document related to the <code> element, and fix the unallowed nested elements. And end tag has been found that does not match the current open element. Check the context to fix the start and end tags.

What is a stray end tag HTML?

As such, “Stray end tag...” means just that an end tag is not allowed in the context where it appears. As the validator's explanation says: “The Validator found an end tag for the above element, but that element is not currently open.

What does start tag body seen but an element of the same type was already open mean?

An opening <body> tag has been found in an incorrect place. Check that it appears only once in the document, right after the closing </head> tag, and that the whole document content is contained within <body> and </body> tags.


1 Answers

this is the minimum html that validates as html5 (except for the lang="en-US")

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <title></title>
  </head>
  <body>
  </body>
</html>

You should have at least this structure

like image 138
bart s Avatar answered Oct 21 '22 20:10

bart s