WHATWG: 4.10.1.1 Writing a form’s user interface
Any form starts with a form
element,inside which are placed the controls. Most controls are represented by the input
element,which by default provides a text control. To label a control,the label
element is used; the label text and the control itself go inside the label
element. Each part of a form is considered a paragraph,and is typically separated from other parts using p
elements. Putting this together,here is how one might ask for the customer’s name:
WAI: Forms > Grouping Controls
Grouping related form controls makes forms more understandable for all users,as related controls are easier to identify… In this example,the div
element has role=group
to indicate that the contained elements are members of a group and the aria-labelledby
attribute references the id for text that will serve as the label for the group…
它还建议使用< fieldset>和< legend>元素. <字段集> element为相关的表单控件提供了一个容器,< legend> element用作标识组的标题.
除此之外,样式和操作是许多开发人员的主要原因.
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!