Our volunteers haven't translated this article into Română yet. Join us and help get the job done!
You can also read the article in English (US).

The HTML <fieldset> element is used to group several controls as well as labels (<label>) within a web form.

Content categories Flow content, sectioning root, listed, form-associated element, palpable content.
Permitted content An optional <legend> element, followed by flow content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts flow content.
Permitted ARIA roles group, presentation
DOM interface HTMLFieldSetElement

Note: unlike almost any other element, the WHATWG HTML Rendering spec suggests min-width: min-content as part of the default style for <fieldset>, and many browsers implement such styling (or something that approximates it).

Note: The <fieldset> element is expected to establish a new block formatting context(See HTML5 spec).


This element includes the global attributes.

disabled HTML5
If this Boolean attribute is set, the form controls that are its descendants, except descendants of its first optional <legend> element, are disabled, i.e., not editable. They won't receive any browsing events, like mouse clicks or focus-related ones. Often browsers display such controls as gray.
form HTML5
This attribute has the value of the id attribute of the <form> element it's related to. Its default value is the id of the nearest <form> element it is a descendant of.
name HTML5
The name associated with the group.
The label for the field set is given by the first <legend> element that is a child of this field set.


Form with fieldset, legend, and label

<form action="test.php" method="post">
    <input type="radio" id="radio">
    <label for="radio">Click me</label>


Specification Status Comment
HTML Living Standard
The definition of '<fieldset>' in that specification.
Living Standard Definition of the fieldset element
HTML Living Standard Living Standard Suggested default rendering of the fieldset and legend elements
The definition of '<fieldset>' in that specification.
HTML 4.01 Specification
The definition of '<fieldset>' in that specification.
Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes Yes Yes Yes Yes
disabled Yes Yes Yes Yes1126
form Yes Yes Yes Yes Yes Yes
name Yes Yes Yes Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes Yes Yes Yes Yes
disabled4.4 Yes Yes ? ?6 Yes
form Yes Yes Yes Yes Yes Yes Yes
name Yes Yes Yes Yes Yes Yes Yes

1. Not all form control descendants of a disabled fieldset are properly disabled in IE11; see IE bug 817488: input[type='file'] not disabled inside disabled fieldset and IE bug 962368: Can still edit input[type='text'] within fieldset[disabled].


See also