【发布时间】:2012-10-16 08:02:09
【问题描述】:
我的 Web 应用程序使用的表单布局如下例所示...
First Name [____________]
Last Name [____________]
Gender () Male () Female
我使用的标记类似于...
<label for="firstName">First Name</label><input type="text" id="firstName" />
<label for="lastName">Last Name</label><input type="text" id="lastName" />
<label>Gender</label>
<fieldset>
<legend>Gender</legend>
<input type="radio" name="sex" id="sex-m" value="m">
<label for="sex-m">Male</label>
<input type="radio" name="sex" id="sex-f" value="f">
<label for="sex-f">Female</label>
</fieldset>
我有以下问题不知道如何解决...
我希望将整个单选按钮组标记为与任何其他字段一样(如上图所示),但没有任何东西可以链接标签(即它的“for”属性没有任何内容,因为每个组中的 radio 有自己的标签,仅用于单个单选按钮的值)没有“for”属性的标签将无法通过可访问性合规性。
字段集的
我曾考虑将
提前致谢。
【问题讨论】:
-
免费咨询。尽可能避免使用单选按钮。对于屏幕阅读器用户和有视力问题的用户(使用它们需要缩放问题和敏捷性),它们是一种痛苦。
标签: checkbox label accessibility radio fieldset