Erm... no. You don't have to put a div
around those fieldset
s.
Given that in your example there's no form elements at all, why should this even be a form? Okay, I know from your previous questions that you're trying to build a WYSIWYG form editor, but that's no excuse to use these sort of HTML.
If I clean up the example you're using, it would probably look something like:
<fieldset style="top:8px; left: 136px; width: 136px; height: 64px;">
<label class="Label" id="Label1" style="top:8px; left: 16px;">one</label>
<label class="TLabel" id="Label2" style="top:32px; left: 16px;">two</label>
</fieldset>
Since some styles are being applied more than once I believe it would be appropriate to store them in a stylesheet instead.
fieldset, label {
position: absolute;
}
You also should have no need to set explicit width and height on the labels, especially if you don't have any form of border or background.
Logically you should also group label
- input
pairs together, for instance with a unordered list. Remember that for accessibility you're going to need the for
attribute to point to the correct input
elements. It would be better to mention the context of what you're doing here.