Fieldsets

Recipe 9.5 Group fields in a form

Sample:

Do you have pets?

Code:

<fieldset>
  <legend>Do you have pets?</legend>
  <div>
    <input type="radio" id="pets_yes" name="pets">
    <label for="pets_yes">Yes</label>
  </div>

  <div>
    <input type="radio" id="pets_no" name="pets">
    <label for="pets_no">No</label>
  </div>
</fieldset>