<?xml version="1.0" encoding="utf-8"?>

The <legend> tag

The <legend> tag Bad Practice
The <legend> tag Best Practice

The <legend> element is nested inside the <fieldset> element and provides a caption for the section content. Use this element right after the <fieldset> start tag and put the caption between its start and end tags.

Generally, grouping controls is a good idea as it makes it easier for users to locate a control they need and looks more user-friendly. Just make sure your grouping makes sense and use descriptive and concise labels for captions.

Improve your UX & Product skills with interactive courses that actually work