HTML and CSS Reference
In-Depth Information
Name
label
Synopsis
<label> . . . </label>
Used to attach information to controls. Each
label
element is associated with exactly one
form control. The
label
element may contain the form control, or it may use the
for
attribute
to identify the control by its
id
value.
Usage
Categories:
Flow content, phrasing content, interactive content, form-associated element, palpable
content
Permitted contexts:
Where phrasing content is expected
Permitted content:
Phrasing content, but may not contain labelable elements unless it is the element's labeled
control and no descendent
label
elements.
Start/end tags:
Required/Required
Attributes
HTML5 Global Attributes
for="
text
text
"
Explicitly associates the
label
with the control by matching the value of the
for
attribute
with the value of the
id
attribute within the control element.