将“标签用于"在单选按钮上 [英] Using "label for" on radio buttons
本文介绍了将“标签用于"在单选按钮上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在单选按钮上使用"label for"参数时,要 508兼容 *,以下正确吗?
When using the "label for" parameter on radio buttons, to be 508 compliant*, is the following correct?
<label for="button one"><input type="radio" name="group1" id="r1" value="1" /> button one</label>
还是这个?
<input type="radio" name="group1" id="r1" value="1" /><label for="button one"> button one</label>
我问的原因是,在第二个示例中,标签"仅包含文本,而不包含实际的单选按钮.
Reason I ask is that in the second example, "label" is only encompassing the text and not the actual radio button.
*《 1973年康复法案》第508条要求联邦机构向残疾人提供软件和网站可访问性.
*Section 508 of the Rehabilitation Act of 1973 requires federal agencies to provide software and website accessibility to people with disabilities.
推荐答案
您几乎明白了.应该是这样:
You almost got it. It should be this:
<input type="radio" name="group1" id="r1" value="1" />
<label for="r1"> button one</label>
for
中的值应该是要标记的元素的ID.
The value in for
should be the id of the element you are labeling.
这篇关于将“标签用于"在单选按钮上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文