This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12439 - Validating a missing HTML tag
Summary: Validating a missing HTML tag
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 major
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 21:01 UTC by XP1
Modified: 2015-08-23 07:07 UTC (History)
0 users

See Also:


Attachments

Description XP1 2011-04-06 21:01:07 UTC
Validating a missing HTML tag

The HTML sample is missing <html lang="en">.

http://validator.w3.org/
This document was successfully checked as HTML5!

<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <title>Test</title>
</head>
<body>
    <section>
        <h2>Test</h2>
    </section>
</body>
</html>
Comment 1 Michael[tm] Smith 2011-04-24 14:41:25 UTC
Hi,

The validator is behaving correctly. The HTML language allows the <html> start tag to be omitted. It always has, both in HTML4 and before, and still in HTML5. (XHTML requires it, but that's a different matter).

For details, see the following section of the HTML5 spec -

http://dev.w3.org/html5/spec-author-view/syntax.html#optional-tags
"An html element's start tag may be omitted if the first thing inside the html element is not a comment."

And, for the sake of comparison, see the following section of the HTML4 spec -

http://www.w3.org/TR/html401/struct/global.html#edef-HTML

Notice the part there that says, "Start tag: optional, End tag: optional".