« 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.

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


The fieldset element |  The legend element

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