How to fix: Document type does not allow element "p" here; missing one of "object", "map", "button" start tag

Most Likely Cause and Fix

Your markup contains a <p> element in a place it does not belong.

The validator is telling you that the <p> must be inside a <object>, <map> or <button> element.

What This Error Means

HTML is often comprised of elements nested inside other elements, such as the placing of an anchor within a paragraph:

    Hello <a href="">World!</a>

There are rules regarding which elements can be nested inside other elements and when this is allowed to happen.

Most notably, block-level elements, such as <div>, are not allowed inside inline elements such as <span>.

This error relates to the when and is telling you that the <p> element on the relevant line number is not allowed unless inside a <object>, <map> or <button> element.

How To Fix It

The specific error message you encountered will refer to a line and column number. This will guide you to the exact point in your markup to which the error relates.

Find the <p> element in question and check to see what element it is inside of.

With respect to the specific portion of the document referred to by the given line and column number, the troublesome <p> must be within a <object>, <map> or <button> element.

Check that you haven't closed a <object>, <map> or <button> element too soon and make sure that the <p> is inside a <object>, <map> or <button> element as expected.

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus