So, if you try to put the input directly into the form without a container element and check in strict order xhtml 1.0, you will get this warning:
the document type does not allow the "enter" element here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins" , "del" start-tag โ the mentioned element is not allowed to appear in the context in which you placed it; the other mentioned elements are the only two allowed there and may contain the said element. This may mean that you need a containing element, or it may be that you forgot to close the previous element.
One possible reason for this message is that you tried a block level (for example, "<p>" or "<table>") inside an inline element (for example, "<a>", "<span>" or "& L; font> ".)
And if you look here at the definition of a W3C form element ( http://www.w3.org/TR/html4/interact/forms.html#h-17.3 ), you will see that the element content model is defined as "% block".
<! ELEMENT FORM - - (% block; | SCRIPT) + - (FORM) - interactive form โ
If you follow the link "% block" ( http://www.w3.org/TR/html4/sgml/dtd.html#block ), which will lead you to elements that are defined as those types of elements. And this:
<!ENTITY % block "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
So, as you can see, the W3C does not define an input or button as a block level element. You can search this page for โinputโ and find that this is the content type โformctrlโ:
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
Indeed, input elements are displayed by default as more of an inline block than a block, given that they do not cause line breaks before / after them. Thus, there is more than just inline and block level elements.
So, in the end, the form needs direct children to be block level elements, and input elements not to be affected. I hope all this clears up.