I was using the
<div class= "..."> <label for=".."> </label><label> ...</label></div>
construct.
I was told that two labels inside a <DIV class= "..."></DIV> are not
allowed by html standard.
Either it was told by someone who does not know "html standard", or
there was some misunderstanding in the communication. It's easy to check
from HTML specifications and to double-check with an HTML validator that
there the construct is permitted. Whether it makes sense is a different
question, and really depends.
The first <label> element would make sense it its for=... attribute
associates it with a control element like <input> and if its content is
non-blank (as opposite to the " " in your example. The second <label>
element, if it really lacks a for=... attribute, would make sense only
if it contains a control element.
In any case, two <label> elements with nothing between them (as in the
example) would be very bad usability and accessibility, since their
contents would run together visually. E.g.,
<label for=...>foo</label><label for=...>bar</label>
would result in "foobar", where clicking on "foo" would activate one
control, and clicking on "bar" would activate another control. I guess
it could sometimes make sense in a weird game...
They are working because the browser will fix
it but its wrong.
I wonder what browsers would be expected to fix here.
Wrapping <label> elements inside a <div> element does not change their
functionality the least.