[html5] When labels point to more than one input

Ian Hickson ian at hixie.ch
Wed Apr 4 11:11:55 PDT 2012


On Wed, 4 Apr 2012, brenton strine wrote:
>
> As I understand it, multiple <label> elements can point to the same 
> input, but one <label> can not point to two or more inputs. That makes 
> sense, but it poses a problem for me when designers have created labels 
> that apply to more than one input. What is the most semantic way to do 
> this?

Just don't bother using a label element for the "uberlabel".


> Basically, it's laid out like a table. For example:
> 
> ------------ Color ---- Volume
> Morning
> Noon
> Evening
> 
> Color can't be a label, because it corresponds to 3 inputs. Morning can't
> either, because it corresponds to two. I guess this looks semantically
> tabular... is there any other way to do this without using a table?

If it's semantically tabular, use a table. <th> is exactly the semantic 
you want here.


<fieldset> with <legend> might also be a good fit here.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list