Which statement about the <legend> element is true?

Learn web design with our comprehensive test guide. Improve your skills with flashcards and multiple choice questions. Each question includes hints and explanations. Get ready to ace your exam!

Multiple Choice

Which statement about the <legend> element is true?

Explanation:
The <legend> element provides the caption for a fieldset, labeling the group of related form controls. When you bundle controls like name, email, and address inside a fieldset, the legend describes what that group is about, helping users quickly understand the purpose of the controls. This labeling is also important for accessibility, as screen readers announce the legend as the heading for the grouped controls, giving context before the user navigates the fields. A best practice is to place the legend as the first child of the fieldset so assistive technologies read it immediately when the fieldset is encountered. For example, you might have a fieldset with a legend like “Contact information” that groups together name, email, and phone fields. This concept isn’t about a table caption or a document title, and it isn’t used as a tooltip—those roles belong to other elements or attributes.

The element provides the caption for a fieldset, labeling the group of related form controls. When you bundle controls like name, email, and address inside a fieldset, the legend describes what that group is about, helping users quickly understand the purpose of the controls. This labeling is also important for accessibility, as screen readers announce the legend as the heading for the grouped controls, giving context before the user navigates the fields. A best practice is to place the legend as the first child of the fieldset so assistive technologies read it immediately when the fieldset is encountered. For example, you might have a fieldset with a legend like “Contact information” that groups together name, email, and phone fields. This concept isn’t about a table caption or a document title, and it isn’t used as a tooltip—those roles belong to other elements or attributes.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy