Most Likely Cause and Fix
Your markup contains a <input>
element in a place
it does not belong.
The validator is telling you that the <input>
must be inside a <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <pre>
, <address>
, <fieldset>
, <ins>
or <del>
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:
<p> Hello <a href="http://example.com">World!</a> </p>
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
<input>
element on the relevant line number
is not allowed unless inside a <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <pre>
, <address>
, <fieldset>
, <ins>
or <del>
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 <input>
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 <input>
must be
within a <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <pre>
, <address>
, <fieldset>
, <ins>
or <del>
element.
Check that you haven't closed a <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <pre>
, <address>
, <fieldset>
, <ins>
or <del>
element too soon
and make sure that the <input>
is inside a <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <pre>
, <address>
, <fieldset>
, <ins>
or <del>
element
as expected.