Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Nhãn

What Label gives you and what your team does.

Conformance

Label meets WCAG 2.2 level AA when used as described on these pages. It renders a native <label>.

What Label gives you

  • A native <label>. With for, the control takes its name from it, and a click on it reaches the control: a larger target for small checkboxes and radios.
  • Text in color.text, above 7:1 on every surface.

What your team does

  • Set for to the control’s id, or wrap the control inside the label.
  • Keep the visible label and the accessible name the same words, so people who use voice control can say what they see.
  • Name groups with a legend, not with a label.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A <label for>
2.5.3 Label in Name A The visible text is the name
3.3.2 Labels or Instructions A A visible label on every control
4.1.2 Name, Role, Value A The control’s name comes from the label