Frontend Development

what is <legend> for?

Submitted by Lcasta07, , Thread ID: 207613

Thread Closed

RE: what is <legend> for?

This post was last modified: 01-06-2021, 11:53 PM by Fishbone
#2
I don't know if you've already figured it out, but the <legend> tag basically defines a caption for a <fieldset> (set of fields in a form). You can see an example here of how it might be used. It helps visually group the fields together and helps for accessibility. This is what it might look like:

[Image: e6kosgW.png]

"Personalia" is the <legend> tag, and the rest are fields. It's grouped by <fieldset>.

Users browsing this thread: 1 Guest(s)