I use a very similar structure to the one created using ASP.NET forests, except that I use divs instead of ps:
<form> <fieldset> <legend>Legendary Fieldset</legend> <div> <label for="textBox">Text Input</label> <input name="textBox" id="textBox" /> </div> <div> <label for="selectBox">Select box</label> <select name="selectBox" id="selectBox"> <option>1</option> <option>2</option> </select> </div> </fieldset> </form>
I use divs because for me it is more semantically correct than p elements, since they are intended for paragraphs of text.
When it comes to styling its also universal structure, because you could, for example, make the set of fields 500px wide and the fieldset div 250px wide and floating, thus reaching side by side. Or you can have the same width for the fieldset as the fieldset div. OR you could have a set of fieldset and fieldset of the same width, and then stick to the class on some divs (say "half") that are half width and float. The possibilities are really endless.
In any case, this is what I use for everyday work - although universal, it may not meet all the requirements.
EDIT . As for definition lists, they are specialized elements that should not be used semantically for form layouts.
source share