I was looking into wrapping various input tags under form and I wonder how many nested tags are possible and not be semantically weird. Some people mentioned about html semantics and why wrapping form is important so … just curious.
ex-1) Here div tag is not related to form but input is still under form so would this be semantically correct? would there be a problem?
<form>
<div>
<input ... />
</div>
</form>
ex-2) Here I believe both label and input tags belong under form but would it be semantically wrong to nest these tags?
<form>
<label>
<input ... />
</label>
</form>
KissMil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1