HTML Fieldset

The HTML fieldset tag will group a set of controls together. For example, if you go to your browser settings you will see that controls are grouped together under a heading such as "downloads".

Syntax

<fieldset>
<legend>Name of field</legend>
<fieldset>
Sponsored Links

Example

<fieldset>

     <legend>Personal Information</legend>
         Surname:<input maxlength="20" name="Surname" type="text" />
         Forename:<input maxlength="15" name="forename" type="text" />
         Address:<textarea cols="20" name="address" rows="5"></textarea>
</fieldset>

<fieldset>
     <legend>Optional Information</legend>
         Your Age:<input maxlength="2" name="age" type="text" />
         Sex:

<select>
<option>Male</option>
<option>Female</option>
<option>Prefer not to say</option>
</select>
</fieldset>

Output

Personal Information

Surname:

Forename:

Address:

Optional Information

Your Age:

Sex: