268
Group Related Form Elements .................................
4 Type <legend>.
5 Type a descriptive legend for
the set of fields.
6 Type </legend>.
1 In your editor, open an HTML
page that contains a form
and form fields.
2 Within the form, type
<fieldset>.
3 Press.
Group Related Form Elements
T
he HTML <fieldset> tag allows you to organize your form into logical groups of elements.
Grouping elements allows you to provide a better layout for your users and may cause longer
forms to look less overwhelming. Within a fieldset, you can nest a
text about the set. The fieldset will appear as a border around its fields, and the legend will display
in the top-left corner of the set. Fieldsets can be nested within other sets, so you can also use it to
organize subgroups, such as sets of check boxes and radio buttons.