Name

<FIELDSET> — NN n/a IE 4 HTML 4

Synopsis

<FIELDSET>...</FIELDSET>

End Tag: Required

A FIELDSET element is a structural container for form elements (as distinguished from the functional containment of the FORM element). In fact, you can define multiple FIELDSET elements within a single FORM element to supply context to logical groupings of form elements. For example, one FIELDSET element might contain text input fields for name and address info; another FIELDSET might be dedicated to credit card information. In applications envisioned by the HTML 4.0 specification, users could use access keys to navigate from one group to another, rather than have to tab ad nauseam to reach the next group.

Internet Explorer 4 boosts the attractiveness of this element by automatically drawing a rule around the form elements within each FIELDSET container. You can also attach a label that gets embedded within the rule by defining a LEGEND element immediately after the start tag of a FIELDSET element. When IE 4 draws the rule, the box extends the full width of the next outermost container geography—usually the document. If you’d rather have the box cinch up around the visible form elements, you have to set the width style sheet property. Unfortunately, the Mac and Windows versions do not render the box set to a specific width the same way: the Windows version comes closest to honoring the pixel count, whereas the Mac version is substantially wider.

Example

<FORM METHOD=POST ACTION="..."> <FIELDSET> ...

Get Dynamic HTML: The Definitive Reference 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.