Organizing the Form Elements

If you have a lot of information to fill out on a form, you can group related elements together to make the form easier to follow. The easier it is for your visitors to understand the form, the more likely they are to fill it out correctly.

Figure 17.10. I have added an id attribute to each fieldset element to facilitate applying styles to each group of form elements.

To organize the form elements:

1.
Below the form tag but above any form elements that you wish to have contained in the first group, type <fieldset>.
2.
If desired, type <legend.
3.
If desired, type align="direction" where direction is left or

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.