« Recipes

HTML Recipes

Checkbox List

A checkbox list is a collection of fields (checkbox inputs), thus fieldset is an appropriate container, with legend serving as the label for the collection.

<fieldset>
<legend>Pizza Toppings</legend>
<p>
<input type="checkbox" id="pepperoni" />
<label for="pepperoni">Pepperoni</label>
</p>
<p>
<input type="checkbox" id="sausage" />
<label for="sausage">Sausage</label>
</p>
</fieldset>

References

The fieldset element |  The legend element

Deeply understand semantic HTML authoring and CSS with my course:
Understanding HTML and CSS.