HTML <fieldset> Tag
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
Attributes
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
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
