I am coding things like this
<div class="panel">
<fieldset style="position: absolute; top:8px; left: 136px; width: 136px; height: 64px;">
<legend> </legend>
<div class="Label" id="Label1" style="position: absolute; top:8px; left: 16px; width: 81px; height: 14px;">one</div>
<div class="TLabel" id="Label2" style="position: absolute; top:32px; left: 16px; width: 54px; height: 14px;">two</div>
</fieldset>
</div>
Do I even need a DIV around a fieldset (or a text input box, radio group, other form input element?
Erm… no. You don’t have to put a
divaround thosefieldsets.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:
Since some styles are being applied more than once I believe it would be appropriate to store them in a stylesheet instead.
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–inputpairs together, for instance with a unordered list. Remember that for accessibility you’re going to need theforattribute to point to the correctinputelements. It would be better to mention the context of what you’re doing here.