HTML: label tag
What is the label tag
The label element creates a label for a input element.
usually used on input tag, such as checkboxes, radio button, etc.
It also makes input forms easier to use. For example, clicking the label of checkbox activates it.
Tie label to input
there are two ways. nesting vs id.
Put input tag inside label tag
<label> <input id="F9HfN" type="checkbox" name="married" value="married" checked> married </label>
Use for-attribute to link to id
Use the for attribute, with value to an id of an input element.
<input id="F9HfN" type="checkbox" name="married" value="married" checked> <label for="F9HfN">Married</label>
Style html label input
when you have a checkbox with label, typically you don't want a newline between them.
you can use this css.
label { white-space: nowrap; }