w3c validator gives 'document type does not allow element “input” here…' error
问题 I got this error when validating my page with w3c's validator. Source: <form action="form.php" method="post"> <input type="text"/> </form> Can someone show me why I may have gotten this error? Thanks in advance! 回答1: This answer applies to XHTML, not HTML5. The form and body element only accept block level children <form action="/"> <input type="submit"> </form> … will produce the error: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6",