Hmmmm…I would be inclined to use a DD with the first name/input in one, both given display:block so they appear on different lines. The DD should be floated with a width (both of them, first and last name)
There is probably a better way but that’s what I would do :). I’m no semantics guru.
I know there are some screen readers that don’t work properly with this method, but I’d be tempted to do this,
<label for="first-name">
First name
<input type="text" name="firstName" id="first-name">
</label>
<label for="last-name">
Last name
<input type="text" name="lastName" id="last-name">
</label>
I agree with Tommy, in that a DL suggests a relationship between labels and inputs that is already there. Though I notice the Fronteers site uses dd’s on all their forms, and they do it partially for double-inputs per label:
However this could be done with classes alone I think.
The screen reader in question who may not like the wrapping-label solution was Window-Eyes 5, and it’s unknown to me whether that has been fixed (they are at version 7.11 by now… good grief, $895.00!).
There was also a similar issue, intermittantly, with some Macs: http://green-beast.com/blog/?p=254
I’ve used labels as wrappers despite this, but I may be unknowingly locking out some users then. I have no clue what the uses of W-E in my country are.
So far I’ve only used it on our intranet (where we have no Window-Eyes users or, indeed, any screen reader users at all (although the intranet is still decently accessible (better than many public sites))).