fieldsetlegend
Fieldset and legend are HTML elements used to group related controls in a form. The fieldset element creates a box around its child form controls, helping users understand the relationship between inputs. The legend element provides a caption for the fieldset, serving as the label for the entire group. In standard usage, the legend should be the first child of the fieldset and describes the purpose of the grouped controls. The content of the legend must be phrasing content; simple text is typical, but inline elements can be used to add emphasis.
Accessibility is a key consideration. Grouping form controls with fieldset and legend improves navigation for assistive
Styling and browser behavior: By default, browsers render a border around the fieldset and place the legend
Common use cases: group related controls such as contact information, account settings, or survey questions. Nested