HTML validation · Document structure

Multiple body elements

A second body start tag appears in the middle of the page, so browsers merge it into the first and the markup is invalid.

How this page is built

A second <body> start tag appears directly after this paragraph. Browsers ignore it, apart from copying any new attributes onto the existing body.

The page continues normally after the second tag.

Why it matters

A page can only have one body. When a second body tag appears, browsers treat it as an error and merge any attributes into the first.

It usually means two complete pages have been joined together, for example by a server-side include or a content block that contains a whole HTML document. Other parts of that second document may cause more problems.

How to check it

View the source and search for the body start tag. More than one match means there is a problem. The W3C Nu HTML Checker reports the second tag, and crawl tools that validate HTML flag it too.

How to fix it

Find where the second body tag comes from and remove it. If a block of content includes a full HTML document, strip it back to just the content that belongs inside the page.

Back to all tests