Favorites

HTML <fieldset> Tag

<fieldset>
HTML TagThis tag is supported by all modern browsers.
Updated 22nd November 2026

The <fieldset> tag groups related controls and labels in a form. A <legend> gives the group a caption, and disabled turns off every control inside.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The <fieldset> HTML element is used to group related elements within a form, creating a logical structure for form controls. It serves both semantic and visual purposes, helping users and assistive technologies understand the relationship between different input fields. By grouping inputs, <fieldset> improves form readability and organization, particularly in complex forms with multiple sections.

Visually, most browsers render a <fieldset> with a border around its contents, giving a clear separation from other parts of the form. Typically, this border is slightly inset and can include rounded corners depending on browser styles or CSS customization.

A <fieldset> can also include a <legend> element, which provides a caption or title for the grouped controls. The <legend> is displayed at the top of the fieldset by default and helps indicate the purpose of the grouped inputs. For example, a fieldset containing contact information might have a legend titled "Personal Details," immediately signaling the context to the user.

Beyond its visual and organizational benefits, <fieldset> contributes to accessibility. Screen readers announce the fieldset and its legend, making it easier for users who rely on assistive technology to navigate forms efficiently. Additionally, the grouping conveys a logical hierarchy that can be useful for form validation scripts and client-side or server-side processing.

Properties

Permitted Parents
Any element that accepts flow content
Content
<legend> as first child; after that block, inline, and text
Start/End Tags
Start tag: required, End tag: required

Example

<form>
<fieldset>
<legend>Personal Information:</legend>
<label for="name">Name:</label>
<input type="text" id="name" size="30">
<label for="email">Email:</label>
<input type="email" id="email" size="30">
</fieldset>
</form>
Open in editor

Attributes

disabled
Specifies that a group of related form elements should be disabled.
form
Specifies one or more forms the fieldset belongs to.
name
Specifies a name for the fieldset.

Global Attributes

The <fieldset> tag also supports the Global Attributes in HTML5

Event Attributes

The <fieldset> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <fieldset> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.