March 30, 2012
Is it correct to use DIV inside FORM?
Question by demas
I’m just wondering what are you thinking about DIV-tag inside FORM-tag?
I need something like this:
<form>
<input type="text"/>
<div> some </div>
<div> another </div>
<input type="text" />
</form>
Is it general practice to use DIV
inside FORM
or I need something different?
Answer by Starx
No, its not
<div>
tags are always abused to create a web layout. Its symbolic purpose is to divide a section/portion in the page so that separate style can be added or applied to it. [w3schools Doc] [W3C]
It highly depends on what your some
and another
has.
HTML5, has more logical meaning tags, instead of having plain layout tags. The section
, header
, nav
, aside
everything have their own semantic meaning to it. And are used against <div>