Associate them with for matching the control’s id (explicit), or by wrapping the control inside the label (implicit). Clicking the label focuses or activates the control — a bigger, more accessible hit area.
Baseline · Widely available.
Not deprecated. Stable across browsers since about July 2015 (and much earlier in practice).
Tip.
Prefer explicit for/id for the most reliable assistive-tech support. Nesting plus for/id together is also fine.
Syntax
HTML Syntax
syntax.html
<label for="id">caption</label>
Both start and end tags are required. Do not nest another <label> inside. Only one labelable control should be associated with a given label.
Keep links outside the label if you need a separate “read terms” link.
Use the same pattern for radio groups with unique ids per option.
Edge Cases & Pitfalls
Most labeling bugs are mismatched ids or mixing interactive content inside the caption.
ids
for must match a unique id
Typos break the association. Duplicate ids in the page are invalid and unpredictable.
placeholder
Placeholder is not a label
Hints vanish while typing. Keep a visible <label> (or other durable accessible name).
interactive
No extra links/buttons inside
Avoid nesting <a> or extra buttons in the label — activation becomes confusing.
headings
Do not wrap headings in label
Headings are navigation landmarks. Style the label with CSS instead of putting <h1>–<h6> inside.
groups
Group titles use legend
For a set of related controls, use <fieldset> + <legend>, not a lone label for the whole group.
Compatibility
Browser Support
The <label> element is Baseline · Widely available. Support has been stable across major browsers since about July 2015.
✓ Baseline · Widely available
<label>
Supported in modern Chrome, Firefox, Safari, Edge, and Opera. Clicking an associated label focuses or activates the control.
100%Modern browser coverage
Google ChromeYes
Supported
Mozilla FirefoxYes
Supported
Apple SafariYes
Supported
Microsoft EdgeYes
Supported
OperaYes
Supported
Internet ExplorerYes · EOL
Supported
<label>Widely available
Bottom line: Use <label> on every form control that needs a visible caption. Prefer explicit for/id association.
Remember
Key Takeaways
Role:<label> captions a form control and links to it programmatically.
Linking: use for/id (explicit) or wrap the control (implicit).
Benefit: better a11y announcements and a larger click/tap target.
Avoid: placeholder-only naming, nested labels, and interactive content inside labels.
One line: Every meaningful form control should have a clear, associated <label>.
UA style
Default CSS Settings
User-agent styles for label are minimal. A typical idea:
default.css
label {
cursor: default;
}
Layout (block vs inline, spacing) is up to your stylesheet — often authors set display: block above fields.
Frequently Asked Questions
The label element provides a caption for a form control. Associating them helps assistive tech announce the purpose and lets users click the text to focus or activate the control.
Explicit: set for on the label to match the control’s id. Implicit: wrap the control inside the label. Prefer explicit for when you can; you can also nest and use for/id together.
No. Placeholder is a temporary hint and disappears when typing. Always provide a visible label (or another durable accessible name).
Yes. Several label elements can share the same for value matching one control id.
Labelable controls include button, input (except type=hidden), meter, output, progress, select, and textarea.
Avoid extra interactive content inside a label. It makes activation confusing. Put links near the control, not nested in the label text.