I just read the following at http://w3fools.com/#html_forms:
Non-block-level elements (such as <input>
) are not valid directly inside <form>
tags until HTML5.
I had never heard of anything along these lines, and every basic HTML tutorial I've seen seems to be just fine with putting input tags directly inside a form tag. So my question has three parts:
- Is the above statement legitimate?
- Why is this the case? (Was it simply an oversight, or were the creators of the HTML spec trying to prevent specific problems by creating this rule?)
- What is the recommended way to construct a form with inputs? (Are we just supposed to create a div or a table directly inside the form tag?)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…