Error More than one html, head, or body tag
Why a stray second <html>, <head>, or <body> tag in the source is invalid, even though browsers quietly merge it away.
The validator flags raw source markup containing more than one <html>, <head>, or <body> start tag.
Example
<!-- Wrong: a second <body> left over from a merge -->
</body>
<body class="theme-dark">
...
</body>
</html>
<!-- Right: merge the attribute onto the single body tag -->
<body class="theme-dark">
...
</body>Why it matters
A valid HTML document has exactly one <html>, one <head>, and one <body>. Browsers handle a stray extra one gracefully — per the HTML5 parsing algorithm, a second start tag for any of these three elements is not turned into a new DOM node; instead any new attributes on it get merged onto the one that's already open, and the tag itself is discarded. That resilience is exactly why this is easy to miss: the rendered page usually looks completely normal. It almost always points to a real mistake in how the document was assembled — two templates concatenated together, a copy-paste that included the wrapper markup twice, or a build step that duplicated a layout partial.
Frequently asked questions
If browsers handle this fine, does it actually need fixing?
The rendering usually looks fine, which is exactly the problem — it hides a real bug in how the page is assembled. The stray tag is a symptom of duplicated or incorrectly merged template output, and similar duplication elsewhere in the same generation step (styles, scripts, meta tags) is easy to miss if this particular tag looks harmless.
Why can't this be detected by inspecting the parsed page in a browser?
Because the browser's parser already discards the duplicate before you'd ever see it in the DOM or dev tools — by the time the page is parsed, only one <body> (with merged attributes) exists. This check has to look at the raw HTML source text instead, before a browser gets to it.