5.1.6 forms.base.label Labels

Toggle example guides Toggle HTML markup

The <label> element represents a caption of a form field. The label can be associated with a specific form control by using the for attribute or by putting the form control inside the label element itself.

Example
Markup: base/forms/forms-label.twig
<div>
  <label class="{{modifier_class}}" for="lableInputText">A label for a text input</label>
  <input type="text" id="lableInputText" placeholder="Enter some text">
</div>

<div>
  <label class="{{modifier_class}}"><input type="checkbox"> A label wrapped around a checkbox</label>
</div>
Source: base/forms/_forms.scss, line 211